-XX:MaxPermSize with or without -XX:PermSize
-XX:PermSize specifies the initial size that will be allocated during startup of the JVM. If necessary, the JVM will allocate up to -XX:MaxPermSize.
-XX:PermSize specifies the initial size that will be allocated during startup of the JVM. If necessary, the JVM will allocate up to -XX:MaxPermSize.
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
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
You have to change the values in the CATALINA_OPTS option defined in the Tomcat Catalina start file. To increase the PermGen memory change the value of the MaxPermSize variable, otherwise change the value of the Xmx variable. Linux & Mac OS: Open or create setenv.sh file placed in the “bin” directory. You have to apply … Read more
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
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.
The main difference from a user perspective – which I think the previous answer does not stress enough – is that Metaspace by default auto increases its size (up to what the underlying OS provides), while PermGen always has a fixed maximum size. You can set a fixed maximum for Metaspace with JVM parameters, but … Read more
When you say you increased MAVEN_OPTS, what values did you increase? Did you increase the MaxPermSize, as in example: export MAVEN_OPTS=”-Xmx512m -XX:MaxPermSize=128m” (or on Windows:) set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m You can also specify these JVM options in each maven project separately.
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
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