How to get Java8 Metaspace dump (not heap dump)

前端 未结 1 1197
孤街浪徒
孤街浪徒 2020-12-14 17:52

Are there any tools that are able to get Metaspace dump from a Java8 hotspot vm ?

相关标签:
1条回答
  • 2020-12-14 18:18

    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.

    0 讨论(0)
提交回复
热议问题