-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mark,
On 8/27/12 3:39 PM, Mark Eggers wrote: > This is long and mostly off-topic. Read if you wish to follow the > fun and games of tracking down permgen leaks, especially with a > third party obfuscated library. :) > JMLPL documentation? http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html#JRE_Memory_Leak_Prevention_Listener_-_org.apache.catalina.core.JreMemoryLeakPreventionListener > I'm also stuck with 6.0.x (where x is 35 in development, and 20 in > production). I do not think that upgrading production is a > possibility. > > However, I'm seeing this in 6.0.35. I was referring to this, which was added in 6.0.34: https://issues.apache.org/bugzilla/show_bug.cgi?id=51688 It's the same thing you do in your own listener (unless getSystemEventQueue() does something even worse than simply calling getDefaultToolkit()). > This was done since the target server was not known (at the time). > Also, this doesn't require changes to a Tomcat server that is not > in my control. > > Using the following leak prevention listener configuration didn't > change the fact that there was a leak on unloading the > application. > > <Listener > className="org.apache.catalina.core.JreMemoryLeakPreventionListener" > > AWTThreadProtection="true"/> Hmm... does that happen in 6.0.35 as well, or only 6.0.20? It was only added in 6.0.34 but it should be working. If not, please re-open the aforementioned bug and explain. > Note that by default I have this configured in my environment. > > <Listener > className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/> > > According to the documentation, this takes care of many leak > issues, including AppContext. Right. > Now the fun begins. I first run this under Tomcat 6.0.35 and JRE > 1.6.0_32 on Windows 7 Home Premium (64 bit). > > Tracking down one of the leaked library classes, I get this. > > --> class sun.awt.AppContext (160 bytes) (static field > mainAppContext:) --> sun.awt.AppContext@0xa0126130 (81 bytes) > (field table:) --> java.util.HashMap@0xa0126168 (64 bytes) (field > table:) --> [Ljava.util.HashMap$Entry;@0xa0126198 (144 bytes) > (Element 1 of [Ljava.util.HashMap$Entry;@0xa0126198:) --> > java.util.HashMap$Entry@0xa04cc760 (44 bytes) (field value:) --> > java.awt.MediaTracker@0xa04cc790 (32 bytes) (field target:) --> > javax.swing.ImageIcon$3@0xa04cc7a8 (379 bytes) (field acc:) --> > java.security.AccessControlContext@0xa04cc888 (41 bytes) (field > context:) --> [Ljava.security.ProtectionDomain;@0xa04cc8a8 (80 > bytes) (Element 3 of > [Ljava.security.ProtectionDomain;@0xa04cc8a8:) --> > java.security.ProtectionDomain@0xa0424dc8 (58 bytes) (field > classloader:) --> > org.apache.catalina.loader.WebappClassLoader@0xa04205d0 (309 > bytes) > > Now, I run this under Tomcat 7.0.27 and JRE 1.7.0._05 on Windows 7 > Home Premium (64 bit). > > Tracking down one of the leaked library classes, I get this. > > --> class sun.awt.AppContext (168 bytes) (static field > mainAppContext:) --> sun.awt.AppContext@0xa0255698 (81 bytes) > (field table:) --> java.util.HashMap@0xa02556d0 (64 bytes) (field > table:) --> [Ljava.util.HashMap$Entry;@0xa0255700 (144 bytes) > (Element 6 of [Ljava.util.HashMap$Entry;@0xa0255700:) --> > java.util.HashMap$Entry@0xa0d81ca8 (44 bytes) (field value:) --> > java.awt.MediaTracker@0xa0d81d28 (32 bytes) (field target:) --> > javax.swing.ImageIcon$3@0xa0d81d40 (364 bytes) (field acc:) --> > java.security.AccessControlContext@0xa0d81e18 (41 bytes) (field > context:) --> [Ljava.security.ProtectionDomain;@0xa0d81e38 (80 > bytes) (Element 3 of > [Ljava.security.ProtectionDomain;@0xa0d81e38:) --> > java.security.ProtectionDomain@0xa0c14c58 (58 bytes) (field > classloader:) --> > org.apache.catalina.loader.WebappClassLoader@0xa0b135c8 (325 > bytes) > > Looks pretty much the same. Hmm... that's ... not supposed to happen. The AppContext leak-prevention has been in Tomcat since back in 2009. Can you confirm that the JreMemoryLeakProtectionListener is actually being loaded? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlA714IACgkQ9CaO5/Lv0PDOTwCff0Gj5/aerx6TyyA/BlcoTQWA JMoAn0Pc9+2N12uc3642XwanFUuy9SmI =6gJi -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org