Bug 37956 - Make 'set static fields to null' ClassLoader leak workaround behaviour configurable
Summary: Make 'set static fields to null' ClassLoader leak workaround behaviour config...
Status: RESOLVED DUPLICATE of bug 41939
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.13
Hardware: All All
: P5 enhancement with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2005-12-18 19:25 UTC by Taras Tielkes
Modified: 2007-04-19 20:00 UTC (History)
0 users

Flag for toggling memory leak workaround (4.94 KB, patch)
2006-12-20 02:09 UTC, Steffen Dienst
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Taras Tielkes 2005-12-18 19:25:11 UTC
The 5.5.13-beta release includes a workaround for webapp Classloader reference
From the changelog:
(Add code to set to null fields in loaded classes when stopping a web
application, as a possible workaround for suspicious garbage collection
behavior. (remm))

The workaround minimizes the symtoms, but not the causes of webapp Classloader
For purposes of diagnotics, I'd like to be able to revert back to the old
behaviour, with the workaround code disabled.

This behaviour should be configurable, similar to how "antiResourceLocking" and
"antiJARLocking" are configurable on the Context level.
Comment 1 Yoav Shapira 2006-04-13 19:01:37 UTC
Changing to an enhancement request.  Taras, if you feel like submitting a patch,
that'd be great.
Comment 2 Steffen Dienst 2006-06-06 10:45:42 UTC

I'd like to vote for this request. We have some problems with redeployment of a 
webapp that seems to result from this workaround. The webapp runs several 
threads (for example within JCS) that use Log4j with commons-logging. After the 
redeployment of the application these threads are trying to access the 
LogManager which results in a NPE as all the fields were set to null. So a 
possibility of disabling of the workaround would be really nice. I seem to have 
a problem accessing the anonymous cvs, so I can't offer any patches, sorry.
Comment 3 Yoav Shapira 2006-06-15 20:10:31 UTC
Is your access to anonymous CVS/SVN better now?
Comment 4 Steffen Dienst 2006-12-20 02:09:35 UTC
Created attachment 19291 [details]
Flag for toggling memory leak workaround

This patch for the container subproject adds a new flag to the context
configuration named "nullifyReferences" that toggles the workaround for memory
leaks on redeployment of webapplications, see changelog of the 5.5.13-beta
release. The default is true.
Comment 5 Steffen Dienst 2006-12-20 02:11:39 UTC

thanks for the help. I finally had the time to look into this. I attached a 
patch that adds the flag we needed in the current trunk version. Per default 
the workaround stays enabled. Additionally there was a minor version mismatch 
in the .classpath file.
Comment 6 Mark Thomas 2006-12-20 04:42:36 UTC
Re-opening since the patch has not been committed to SVN.
Comment 7 Thorsten Berger 2007-01-13 11:10:13 UTC
Is there any progress here?
We are facing some serious issues with this memory leak workaround (e.g. using
ojb cross-context prevents redeployment) and would like to see the config option
in one of the next releases.

Regards, Thorsten
Comment 8 Mark Thomas 2007-04-19 20:00:53 UTC
The behaviour will be made optional in TC5.5.x

*** This bug has been marked as a duplicate of 41939 ***