Java: non heap memory analysis
The problem we have is that our non heap memory has been growing So we have to restart our Jee (java8) – webapp every three days (as shown in the screenshot here: screenshot from non heap - and heap memory)
I've tried to find something to fill the non - heap But I can't find any tools to create non heap dumps What do you think I can investigate and find out which elements are more and more?
Java version
java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14,mixed mode)
Tomcat version
Apache Tomcat Version 7.0.59
Solution
The non heap memory usage provided by memorypoolmxbean calculates the following memory pools:
>Metaspace > compact class space > code cache
In other words, standard non heap memory statistics include the space occupied by compiled methods and loaded classes Most likely, increased non - heap memory usage indicates a classloader leak
use
>Jmap - clstats PID dump class loader statistics; > jcmd PID GC. class_ Stats is used to print detailed information about the memory usage of each loaded class The latter requires - XX: unlockdiagnosticvmoptions