How to get Java8 Metaspace dump (not heap dump)

狂风中的少年 提交于 2019-11-29 11:46:11

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/37919215/how-to-get-java8-metaspace-dump-not-heap-dump

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!