I did a performance test with Apache Bench on Tomcat6.0.16.
During the test,I got many error in catalina.out.
SEVERE: Caught exception (java.lang.OutOfMemoryError: Java heap space) 

    # ./ab -c 200 -n 300000 http://******/sample/test.jsp
    Benchmarking 60.239.255.6 (be patient)
    Completed 30000 requests
    Completed 60000 requests
    apr_recv: Connection reset by peer (104)
    Total of 61428 requests completed =>OutOfMemoryError

I can't understand why OutOfMemory caused so fast.
I set session-timeout 1minute on CATALINE_BASE/conf/web.xml and 
docBase/WEB-INF/web.xml like this.

web.xml ==============================================
    〜
    </servlet-mapping>

    <session-config>
        <session-timeout>1</session-timeout>
    </session-config>

   <mime-mapping>
    〜
=======================================================

I did the same test on the same machine with Tomcat5.5.26.
Also used the same JDK 1.6.0_06 and mod_jk 1.2.21 . Apache version is 2.0.59.
Apache and Tomcat exited the same machine.
The test finished with no error. Of course I used the same JSP.

GC parameter , maxThreads and Apache configuratiion was the same.
I got heap dump and checked top of the heap size with NetBeans

java.util.concurrent.ConcurrentHashMap$Segment       size 23% / instance 22.6%
java.util.concurrent.locks.ReentrantLock$NonfairSync size 21% / instance 22.6%
java.util.concurrent.ConcurrentHashMap$HashEnry[]    size 12.1% / instance 22.6%

org.apache.catalina.session.StandardSession refered 
java.util.concurrent.ConcurrentHashMap$Segment.
It looks like StandardSession is loop ConcurrentHashMap$Segment.
But I am not sure how to look NetBeans IDE,perhaps mistakes this view.

As I wanted to know conserned with session , I test JSP with session 
invalidated version.
I put <% session.invalidate();%> in JSP and I did test.

Result is no OutOfMemory.
So I thought this issue is conserned with session.

Do someone have any solution ?



test.jsp ==============================================
<%@ page contentType="text/html;charset=Shift_JIS" %>
<%! String str = "Tomcat test"; %>

<html>
<head>

<title><% out.println(str); %></title>

</head>

<body>
<%=str%>
</body>

</html>
=======================================================

server.xml  ==============================================

    <Connector port="8082"
               protocol="AJP/1.3"
               enableLookups="false"
               maxSavePostSize="0"
               request.registerRequests="false"
               useBodyEncodingForURI="true"
               backlog="100"
               bufferSize="-1"
               tcpNoDelay="true"
               maxThreads="512"
               tomcatAuthentication="false" />

    <Engine name="sample_Engine"
            defaultHost="localhost">

      <Host name="localhost"
            appBase=""
            autoDeploy="false"
            unpackWARs="false"
            errorReportValveClass=""
            deployXML="false"
            deployOnStartup="true" >

      </Host>

    </Engine>

  </Service>

</Server>

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

context.xml (sample.xml)================================

<Context docBase="/***/****/sample"
         cookies="true"
         crossContext="false"
         privileged="false"
         override="false"
         reloadable="false"
         allowLinking="false"
         caseSensitive="false"
         swallowOutput="true">

    <Valve className="org.apache.catalina.valves.AccessLogValve"
           directory="/**/***/***/access"
           suffix=".log"
           pattern="common"
           resolveHosts="false"
           rotatable="true" />

</Context>

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

Thanks

-- 
Kanako Shimizu


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to