You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ka...@jb4.so-net.ne.jp on 2008/04/27 11:03:56 UTC

Tomcat6.0.16 is too easily to be OutOfMemory compared with Tomcat5.5

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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Re:Tomcat6.0.16 is too easily to be OutOfMemory compared withTomcat5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kalpanab [mailto:kalpanab_2006@yahoo.com]
> Subject: Re: Re:Tomcat6.0.16 is too easily to be OutOfMemory compared
> withTomcat5.5
> 
> I am also having the same issue. Does any one have solution 
> for this issue?

You resurrected a thread that was nearly 18 months old... and since the OP did not provide any further information, I would have to assume that based on Chris' comments, he actually didn't have a problem.

If you are having OOME problems in an environment other than the completely artificial one the OP had, please start a new thread providing more information, including the exact Tomcat version, JVM level (and 32/64 bit mode), platform you're running on, and any JVM command-line parameters you have set.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Re:Tomcat6.0.16 is too easily to be OutOfMemory compared with Tomcat5.5

Posted by kalpanab <ka...@yahoo.com>.
Hi All,

I am also having the same issue. Does any one have solution for this issue?

Thanks,
Kalpana


kana-s wrote:
> 
> 
> Thank you for replying.
> 
> -Xms and -Xmx were 256MB. I changed 512MB but the result was same. 
> 
> As session in implicit object in JSP , 
> if I don't set <% session.invalidate();%>, sessions will create.
> 
> The jsp which I used the test isn't set <% session.invalidate();%>.
> So I thought sessions were created. 
> Is my thought wrong?
> 
> I did the same test as Tomcat5.5 with that jsp.
> The test was completed finished atTomcat5.5  but Tomcat 6.0.16 iwasn't.
> So I thougft it is strange .
> 
> Instead of Apache Bench, Next I tried the Performance Center.(one of the
> load test tool)
> 
> That  added 1 virtual user per 10 secs. 
> Only 30 virtual users, OutOfMemory was occured at Tomcat6.0.16,
> but Tomcat 5.5.26 was 270 virtual users!
> 
> I want to know this behavior is defaut in Tomcat6.0 or I had a mistake
> configurations. 
> 
>> Chuck
> I put the file path to appBase and deleted errorReportValveClass.
> 
> Thanks.
> 
> -- 
> Kanako Shimizu <ka...@jb4.so-net.ne.jp>
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat6.0.16-is-too-easily-to-be-OutOfMemory-compared-with-Tomcat5.5-tp16921744p25779235.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re:Tomcat6.0.16 is too easily to be OutOfMemory compared with Tomcat5.5

Posted by Kanako Shimizu <ka...@jb4.so-net.ne.jp>.
Thank you for replying.

-Xms and -Xmx were 256MB. I changed 512MB but the result was same. 

As session in implicit object in JSP , 
if I don't set <% session.invalidate();%>, sessions will create.

The jsp which I used the test isn't set <% session.invalidate();%>.
So I thought sessions were created. 
Is my thought wrong?

I did the same test as Tomcat5.5 with that jsp.
The test was completed finished atTomcat5.5  but Tomcat 6.0.16 iwasn't.
So I thougft it is strange .

Instead of Apache Bench, Next I tried the Performance Center.(one of the load test tool)

That  added 1 virtual user per 10 secs. 
Only 30 virtual users, OutOfMemory was occured at Tomcat6.0.16,
but Tomcat 5.5.26 was 270 virtual users!

I want to know this behavior is defaut in Tomcat6.0 or I had a mistake configurations. 

> Chuck
I put the file path to appBase and deleted errorReportValveClass.

Thanks.

-- 
Kanako Shimizu <ka...@jb4.so-net.ne.jp>


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


RE: Tomcat6.0.16 is too easily to be OutOfMemory compared with Tomcat5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kana-s@jb4.so-net.ne.jp [mailto:kana-s@jb4.so-net.ne.jp] 
> Subject: Tomcat6.0.16 is too easily to be OutOfMemory 
> compared with Tomcat5.5
> 
>       <Host name="localhost"
>             appBase=""
>             errorReportValveClass=""

While you're applying the changes Chris S suggests, consider fixing the
above as well.  The appBase should never be a null string, and running
without an errorReportValveClass is completely unrealistic.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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


Re: Tomcat6.0.16 is too easily to be OutOfMemory compared with Tomcat5.5

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kana,

kana-s@jb4.so-net.ne.jp wrote:
| 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.

With a 1-minute session timeout, I'm guessing you created a billion
sessions in a few seconds and that's what killed you. 'ab' AFAIK does
not try to manage sessions or anything like that.

If you issue that many requests, and each request creates a new session,
you'll very quickly run out of memory.

Do all requests in your webapp create sessions? How big is your heap?

| 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 ?

Set session="false" in your JSP and you won't create useless sessions.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgUg0YACgkQ9CaO5/Lv0PAtowCfU4AUe68TYHciOBaW6B2LLGfW
xQwAn1+4PlqmhRarBR0WaVnQtSd5gZqe
=Xsyf
-----END PGP SIGNATURE-----

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