Java JVM, PermGen and String.intern(): More tips about dealing with those pesky OutOfMemory errors.
I got pingback from haakon on a great post entitled Java Permgen space, String.intern, XML parsing. I always love a good debugging session story, when you throw in a memory leak that’s an instant Nerdgasm. This post covers String.intern() , a bit more about Classloaders, and leaves you with a great tools and techniques checklist for solving memory problems in Java.
This week I have been poking through the innards of a web application trying to find out why we were leaking memory (in the permanent generation) like crazy. After a bit of digging I isolated it down to a line that looked like this:
Document doc = SAXParser.new().parse( stringContainingXML );
If you found this interesting, you might want to read a Java Performance Tuning