How can I view the MaxPermSize in JVM?

浪子不回头ぞ 提交于 2019-12-06 15:32:10

You can use JVisualVM in the JDK/bin directory to monitor everything about a java process.

Edward Torbett

In direct answer to your question, java.lang.management.ManagementFactory has method to get information on all of the memory pools used by java, including the PermGen space and other non-heap memory pools:

List<MemoryPoolMXBean> memoryPoolMXBeans = java.lang.management.ManagementFactory.getMemoryPoolMXBeans();

for (MemoryPoolMXBean bean : memoryPoolMXBeans) {
    //Iterate over pools here
}

There's a couple of utilities that come in the jsdk i believe - try jstat -gcpermcapacity. Another trick that can sometimes be helpful is ps -fwwwC java (assuming you are running this on a linux box)

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