问题
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