Howto easily monitor usage of Eden and Survivor Spaces

前提是你 提交于 2019-12-22 13:58:09

问题


What is the best way howto monitor usage of Eden and Survivor heap spaces?

I have all the GC logging options on but I can see only YoungGen occupation:

-XX:+PrintTenuringDistribution -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=jvm.log -server -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Xloggc:gc.log -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -showversion -XX:+PrintClassHistogramBeforeFullGC -XX:+PrintClassHistogramAfterFullGC -XX:+UseParallelOldGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=15

I would use VisualGC but cannot find its distribution anywhere. The default distribution of VisualVM that comes with JDK does not come with VisualGC. The VisualGC plugin links to the VisualGC site are broken.

UPDATE: jstat is what I was looking for, specifically :

    jstat -gcutil -t <pid> <interval> <number_of_samples>

回答1:


Depending on what you mean by "monitor", you might just need jstat. Check out the -gc* options.




回答2:


According to this page, you can download the relevant plugin center "updates.xml" file, an install it per the instructions. Then you can install the VisualGC plugin.

But the page also says that you should simply be able to install plugins using "Tools | Plugins | Available Plugins".

The links to projects on java.net are often broken in my experience. You typically have to look harder to find stuff that is hosted there.




回答3:


If I understand you correctly, I think you can use JVisualVM to monitor your Java applications.



来源:https://stackoverflow.com/questions/13924565/howto-easily-monitor-usage-of-eden-and-survivor-spaces

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