Bug 50222 - JreMemoryLeakPreventionListener should speculatively cause memory leaks using the system ClassLoader
Summary: JreMemoryLeakPreventionListener should speculatively cause memory leaks using...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 11:00 UTC by Christopher Schultz
Modified: 2010-11-25 12:19 UTC (History)
0 users



Attachments
Patch to add tccl push/pop around speculative ClassLoader pinning. (1.25 KB, patch)
2010-11-05 13:54 UTC, Christopher Schultz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Schultz 2010-11-05 11:00:08 UTC
JreMemoryLeakPreventionListener intentionally invokes methods known to pin the context ClassLoader in memory in order to avoid having a WebappClassLoader unintentionally pin itself. This may cause undesirable behavior in embedded environments.

Instead, JMLPL could use a security context to temporarily set the current context ClassLoader to be the system ClassLoader and solve the embedded situation without the client having to remember to take this care.
Comment 1 Christopher Schultz 2010-11-05 13:54:37 UTC
Created attachment 26260 [details]
Patch to add tccl push/pop around speculative ClassLoader pinning.

Patch to add tccl push/pop around speculative ClassLoader pinning.

Patch does not include /lots/ of re-indentation required by a newly-added try/catch block surrounding everything.
Comment 2 Mark Thomas 2010-11-10 08:04:11 UTC
Nice idea and thanks for the patch.

It has been applied to 7.0.x and will be included in 7.0.5 onwards.
Comment 3 Mark Thomas 2010-11-25 12:19:38 UTC
Fixed in 6.0.x and will be included in 6.0.30 onwards.