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

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.

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

Dealing with “java.lang.OutOfMemoryError: PermGen space” error

The solution was to add these flags to JVM command line when Tomcat is started: -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled You can do that by shutting down the tomcat service, then going into the Tomcat/bin directory and running tomcat6w.exe. Under the “Java” tab, add the arguments to the “Java Options” box. Click “OK” and then restart the service. … Read more