Hi Guido Thanks for taking the time to answer my questions and make suggestions. My replies below.
-----Original Message----- From: Jäkel, Guido [mailto:g.jae...@dnb.de] Sent: Tuesday, July 19, 2016 10:31 AM To: 'Tomcat Users List' Subject: RE: OutOfMemoryError: PermGen space >> In Visual VM, under File, Compare Memory Snapshots, it does not see the >> snapshots I generated. The snapshots appear to be extension *.apps, >> but the compare function looks for files with extension *.nps. I don't >> know how to get the compare function to work. >> >> Not sure where to go from here. Got any suggestions? > > You may pull heap dumps and use the Eclipse Memory Analyzer Toolkit (aka > MAT) (http://www.eclipse.org/mat/) to discover stale objects danging on > the webapps classloader. The tool may be used stand-alone (via an included > Eclipse RCP) or as an Eclipse Plugin. Thanks for the suggestion. I've never used that tool before. Will it read the heap dumps generated by Visual VM? I'll either try MAT or see if IntelliJ Idea has one, since Idea is my IDE. [SNIP] > If possible in any way, please upgrade to (Oracle) Java 1.8, because to > my experience, there seems even notable fixes inside the Java core > libraries. And enable the newest "G1" garabarge collector, too. Without > changing any line in our apps, the JVM heap usage was notable smaller > and smoother. Because of migrating with the [...] VM, the PermGen-Heap > have been replaced by the Metaspace-Heap. Some parts of allocation now > in the main heap and is reclaimable, some other remain. But technical, > the Metaspace heap is now handled as all others, therefore it has no > real separate size. You may set (and should) a limit, but per default > it's unlimitied within the main heap. I plan on upgrading to Java 1.8 soon but not quite yet, hoping to figure this out before doing so. I don't want to change something that could potentially make the symptom go away but simply hide the underlying problem. Thanks for reminding me about G1. Is there any reason not to enable G1 garbage collection? Also, Google says that there are potentially 3 ways of enabling it: 1. Customizing the Tomcat startup procedures to add the -XX:+UseG1GC option. This requires modifying the Tomcat startup every time you install Tomcat. 2. Setting the JAVA_TOOL_OPTIONS Java environment variable. This makes G1 default for all Java applications. 3. Setting the JAVA_OPTS environment variable that Tomcat might look for? Not sure about this one. > Greetings > > Guido -- Cris Berneburg, Lead Software Engineer, CACI