tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reich, Matthias" <matthias.re...@siemens.com>
Subject Memory Leak with Comet
Date Tue, 24 Apr 2007 14:00:55 GMT
Hello,

I am sorry that I did not address the memory leak issue to the users
list first, before sending this bug report:
http://issues.apache.org/bugzilla/show_bug.cgi?id=42217

I am aware of the fact that memory allocation occurs in Java progams,
and that Tomcat will exploit some resource pools before resources are
recycled.
I am afraid that I did not consider that I should have been more
explicit in my description.

If memory allocation of Tomcat continues until I see messages like

org.apache.coyote.http11.Http11NioProcessor: Error processing request
java.lang.OutOfMemoryError: Java heap space

when I run my simple test webapp with JAVA_OPTS=-Xmx512m, this looks for
me as if there is a memory leak.

Surely, the memory leak could be in my Servlet, and the queue which
holds events until they are answered asynchronously is the first
candidate to look at in more detail.
For this reason, the Servlet logs the size of the queue whenever an
element is removed from the queue.
I saw that the queue size did not increase over the time, but memory
consumption of Tomcat did.

Therefore, I am pretty sure that there is either a memory leak in Tomcat
or I still don't understand how the Comet interfaces shall be used.

If I modify the index page of my webapp in a way that it sends only
requests to the 'traditional' servlet, memory does not increase.
Also, if it sends requests to the Comet servlet which are answered
synchronously, memory consumption is stable.
Only if comet requests are answered asynchronously,  memory does
increase.

I did not always wait until I saw the OutOfMemoryError, but the effect
is reproducible on my machine.

Any opinions about this?

Regards,
Matthias Reich




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message