查看JVM堆内存对象的分布状况

[b]1. Use JConsole[/b] to collect the memory info

0) Goto jdk\bin to start jconsole.
1) Listen to the started Java Application
2) Navigate to Tab MBeans > com.sun.management > HotspotDiagnostic > Operations > dumpHeap
3) Fill the output file name for parameter p0
4) Click button "dumpHeap" to generate the output file.

[b]2. Use jhat[/b]
use jhat command to start the web server for the data presenation based on the output file by jconsole.
jhat

3. Start browser to open it like http://localhost:7000

All the object heap histo is shown on the web page.

你可能感兴趣的:(查看JVM堆内存对象的分布状况)