My Jboss throw a "java.lang.OutOfMemoryError " often! So I write a jsp to test it!

===============================================
<%@ page language="java" %>
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*"%>
<%
        Integer j = (Integer)session.getAttribute("i");
        if(j == null)
        {
                j = new Integer(1);
        }
        int i = j.intValue();

        String fileName = (String)session.getAttribute("fileName");
        if(fileName == null)
        {
                fileName = "testjj1.jsp";
        }
        
        if(i > 100000)
        {
                fileName = "";
        }
%>


Test.JSP
<meta http-equiv="refresh" content="0;url=<%=fileName%>">


<%
        String filePath = getServletContext().getRealPath("/");
        //String filePath = 
"D://bea//weblogic81//samples//server//examples//src//test//";
        File file1 = new File(filePath + "testjj.jsp");
        
        System.out.println((new java.util.Date()).toString() + " -- jj -- " + i);
        filePath = filePath + "testjj" + i + ".jsp";
        File file = new File(filePath);

        InputStream stream = new FileInputStream(file1);
        OutputStream bos = new FileOutputStream(file);
        int bytesRead = 0;
        byte[] buffer = new byte[8192];
        while ((bytesRead = stream.read(buffer, 0, 8192)) != -1)
        {
                bos.write(buffer, 0, bytesRead);
        }
        bos.close();
        stream.close();
        
        file = null;
        file1 = null;
        
        i++;
        session.setAttribute("i", new Integer(i));
        session.setAttribute("fileName", "testjj" + i +".jsp");
%>
Just for Test!



===============================================

When the jsp number is 4325, Jboss throw a "java.lang.OutOfMemoryError
"! 

What can I do? Who can help me!

<a 
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3825872#3825872";>View 
the original post</a>

<a 
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3825872>Reply 
to the post</a>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to