Is there a way to get the peak memory used at any given point during a java program run? So far I've only seen solutions that give total memory consumed.
You can try this JDK tools for heap analyzis:
VisualVM
jstat
(console tool ) RSS mem usage can be found on unix by comman line tools ps
or top
, or by JDK tool:
jcmd <pid> VM.native_memory detail.diff
(java process should be run with -XX:NativeMemoryTracking=summary
JAVA_OPTS ) RSS Peak usage can be found on linux in /proc/<pid>/status
file in VmHWM
field ( man ).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.