How to analyze PermGen contents?

The PermGen normally consists of the string literal pool and loaded classes. To answer part of your problem, i.e. the string literal pool I wrote a utility to print a running JVM’s string literal pool. It is available here: https://github.com/puneetlakhina/javautils/blob/master/src/com/blogspot/sahyog/PrintStringTable.java It is based on PermStat, which is the class used to print permgen stats by … Read more

What does PermGen actually stand for?

Permanent Generation. Details are of course implementation specific. Briefly, it contains the Java objects associated with classes and interned strings. In Sun’s client implementation with sharing on, classes.jsa is memory mapped to form the initial data, with about half read-only and half copy-on-write. Java objects that are merely old are kept in the Tenured Generation.

How to clear PermGen space Error in tomcat

The PermGen space is what Tomcat uses to store class definitions (definitions only, no instantiations) and string pools that have been interned. From experience, the PermGen space issues tend to happen frequently in dev environments really since Tomcat has to load new classes every time it deploys a WAR or does a jspc (when you … Read more

ThreadLocal & Memory Leak

PermGen exhaustions in combination with ThreadLocal are often caused by classloader leaks. An example: Imagine an application server which has a pool of worker threads. They will be kept alive until application server termination. A deployed web application uses a static ThreadLocal in one of its classes in order to store some thread-local data, an … Read more

Increase permgen space

You can use : -XX:MaxPermSize=128m to increase the space. But this usually only postpones the inevitable. You can also enable the PermGen to be garbage collected -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Usually this occurs when doing lots of redeploys. I am surprised you have it using something like indexing. Use virtualvm or jconsole to monitor the Perm … Read more

PermGen elimination in JDK 8

Reasons of ignoring these argument is permanent generation has been removed in HotSpot for JDK8 because of following drawbacks Fixed size at startup – difficult to tune. Internal Hotspot types were Java objects : Could move with full GC, opaque, not strongly typed and hard to debug, needed meta-metadata. Simplify full collections : Special iterators … Read more

tech