tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: WebappClassLoader weak/soft reachable
Date Tue, 06 Nov 2012 19:30:03 GMT
Hash: SHA1


On 11/6/12 10:37 AM, Konstantin Kolinko wrote:
> 2012/11/6 Christopher Schultz <>:
>> I was playing around with the manager webapp today and just for 
>> grins, I redeployed my webapp and then hit the "Find Leaks" 
>> button to see how long it would take Tomcat to decide that my 
>> webapp reloads cleanly.
>> It didn't. That is, my webapp does not appear to cleanly reload. 
>> Which was a surprise to me.
>> I waited a few moments and tried again: Find Leaks still says 
>> "there's a leak, confirm with a profiler". So I attached with 
>> YourKit, took a memory snapshot and started looking around: I 
>> found 4 WebappClassLoaders (1 for manager, 1 for my webapp, 1
>> for a dummy ROOT webapp I have and finally a started=false 
>> WebappClassLoader for the old pre-reload of my webapp).
>> Interestingly, the started=false WebappClassLoader says that it 
>> is Weak/Soft Reachable. That means that tracing GC roots doesn't 
>> really work.
>> Requesting GC via the manager changes nothing. Requesting GC via 
>> the profiler changes nothing.
>> Does anyone have any good ideas for tracking-down what is
>> keeping this WebappClassLoader in memory? Do I just have to
>> intentionally exhaust the heap to convince the MM/GC that it
>> should toss-out this WCL?
>> Any suggestions would be greatly appreciated.
> 1) There exists an -X option that disables explicit GC calls. I 
> hope that you are not using it.

No, I don't do any of that foolishness.

> 2) I know of a bug in JVM when a certain kind of leak goes 
> undetected. I mean the leak through a shared Exception instance
> and its native stacktrace. See
> (Linked 
> from

I don't create any of my own Exception objects that get shared. Could
this be something introduced by Tomcat itself, or more likely some
dependent library of mine?

Since I can't readily trace the WebappClassLoader to its GC roots, do
you have any suggestions for identifying the specific cause in my case?

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message