Notes to self

Whatever I feel like writing

Return of the PermGen

,

This appears to be the third installment in the saga of my PermGen problems.

For good measure, here are the previous posts:


The newsflash this time is that I stumbled upon some guy Thompson's blog post about this very problem - by itself nothing new; concluding by recommending a JVM with infinite perm-space (BEA or IBM).

The interesting part, however, is stoney's comment where he links to two posts on a blog by Frank Kieviet.

The first of Franks posts is concerned with what the PermGen error is really all about, namely how these leaks in the reloading classloaders in our application servers happen. His second post is a bit more involved and shows how you can use new profiling tools in Java 6 to track down classloader leaks.

So the good news is that we now have the knowledge and tools required to kill this bug.
The bad news is that we've also learned that walking the walk will probably be a lot tougher than talking the talk.

We have to scrutinize our dependency tree, and think really, really, REALLY hard before we put a jar in our servers indorsed directory.

In fact, I think I'll try an experiment tomorrow (today, actually, after I've slept) where I strip down a Tomcat instance (JBoss is probably too intertwined with itself to really strip down) and create some web applications who's only runtime dependencies are the servlet-api and the JRE!

I should really think that classloader leaks are really hard to create with something as simple as the servlet-api, and if you use your JRE with care, then it should damn well be possible to avoid classloader leaks with that dependency as well.

Man, I'm really excited about the idea that there's actually hope for us lay-coders to actually rid ourselves of this nasty ghost-bug-thing/issue.

I'll be sure to report back when I've done some experiments with this new knowledge!

Principles of a Well Behaved Code GeneratorChanging the Eclipse workspace dir.

Comments

Unregistered user Sunday, September 30, 2007 6:28:39 AM

stoney writes: the only thing that prevented me from taking a closer look at possible classloader leaks in my application(s), was the missing support for tracing classes in jhat. Fortunately, from JDK7b2 this issue will be fixed ( http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6484556 ), as can be seen in SUN's bug tracking system. In addition, a JDK6 patch from Frank was submitted to jdk-collaboration.dev.java.net. Another interesting thing about jhat I tumbled over, is the possibility to create custom reports by using jhat's OQL interface. A. Sundararajan's blog has some really good posts on that topic, if you wanna read into that: *) querying java heap with OQL: http://blogs.sun.com/sundararajan/entry/querying_java_heap_with_oql *) jhat's javascript interface: http://blogs.sun.com/sundararajan/entry/jhat_s_javascript_interface

Unregistered user Sunday, September 30, 2007 6:30:25 AM

stoney writes: sorry, i overlooked the notice on no HTML for anonymous users ...

Christian Vest Hansenkarmazilla Sunday, September 30, 2007 9:18:52 AM

Thanks for the links!

And sorry about this stupid blog software; even I can't make your urls clickable it seems.

Unregistered user Thursday, January 7, 2010 5:26:22 AM

mm writes: Few pointers here as well, http://minmaxmim.blogspot.com/2010/01/javalangoutofmemoryerror-java-heap.html http://minmaxmim.blogspot.com/2010/01/javalangoutofmemoryerror-permgen-space.html ~~~ http://www.captivecaptures.blogspot.com/

Write a comment

New comments have been disabled for this post.