You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jochen Wuttke <wu...@lu.unisi.ch> on 2008/11/18 10:03:56 UTC

Re: Potential reuse of TagHandlers implementing JspIdConsumer?

Hi,

I'd like to bump this issue once more.
I finally had some time to run some more experiments to see what  
happens with TagHandlers that implement JspIdConsumer. My setup is  
Tomcat 6 + MyFaces + JSF CarDemo, and I'm using AspectJ to trace  
creation and garbage collection of objects implementing JspIdConsumer.  
My experiments indicate the following:

1. JspIdConsumer instances do NOT get garbage collected after a page  
has finished processing.
2. JspIdConsumer instances do NOT get garbage collected after a  
session times out.
3. SOME JspIdConsumer instances DO get garbage collected when a given  
JSP-generated page is reloaded or accessed in a different session.

To obtain these results I ran Tomcat with very little heap memory (it  
seems it starts fine with the 64M default), loaded the car demo in  
several browser sessions and ran through all the other JSP/Servlet  
examples that come with Tomcat to increase the memory consumption and  
trigger GC. Unfortunately I don't have the time and tools to do a  
proper stress test.
In any case, considering the specification of JspIdConsumer, which  
states that instances may never be reused, the caching of these  
instances as it is done in current JSPs is unnecessary, and since  
these instances don't seem to be GC'd, this seems to be a memory leak.

Could the developers confirm this or suggest what is going on that I'm  
missing?

Jochen Wuttke

-----------
PhD Candidate
Faculty of Informatics
University of Lugano
Via Giuseppe Buffi 13
CH-6904 Lugano - Switzerland

phone: +41 58 666 4308
www.inf.unisi.ch/phd/wuttke






---------------------------------------------------------------------
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: Potential reuse of TagHandlers implementing JspIdConsumer?

Posted by Mark Thomas <ma...@apache.org>.
Jochen Wuttke wrote:
> Hi,
> 
> I'd like to bump this issue once more.
> I finally had some time to run some more experiments to see what happens
> with TagHandlers that implement JspIdConsumer. My setup is Tomcat 6 +
> MyFaces + JSF CarDemo, and I'm using AspectJ to trace creation and
> garbage collection of objects implementing JspIdConsumer. My experiments
> indicate the following:
> 
> 1. JspIdConsumer instances do NOT get garbage collected after a page has
> finished processing.
> 2. JspIdConsumer instances do NOT get garbage collected after a session
> times out.
> 3. SOME JspIdConsumer instances DO get garbage collected when a given
> JSP-generated page is reloaded or accessed in a different session.
> 
> To obtain these results I ran Tomcat with very little heap memory (it
> seems it starts fine with the 64M default), loaded the car demo in
> several browser sessions and ran through all the other JSP/Servlet
> examples that come with Tomcat to increase the memory consumption and
> trigger GC. Unfortunately I don't have the time and tools to do a proper
> stress test.
> In any case, considering the specification of JspIdConsumer, which
> states that instances may never be reused, the caching of these
> instances as it is done in current JSPs is unnecessary, and since these
> instances don't seem to be GC'd, this seems to be a memory leak.
> 
> Could the developers confirm this or suggest what is going on that I'm
> missing?

3 looks like a possible memory leak although I can't be certain with the
information provided here. A simple test case (that doesn't use JSF) would
help.

1 & 2 could just be poor recycling rather than a leak. Again, a test case
would help clarify this.

Mark



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