It seems you encounter a class loading leak.
Use
jmap -clstats PID
to dump class loader statistics;
jcmd PID GC.class_stats
to print the detailed information about memory usage of each loaded class. The latter requires -XX:+UnlockDiagnosticVMOptions
.
The heap dump will also help, because each class in the Metaspace has a corresponding java.lang.Class
instance in the heap.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…