I need to be able to do some memory sampling on a VM that's running on a linux box that doesn't have any XWindows running. I've tried to do it remotely but apparently JVisualVM does not support remote memory sampling.
What are my alternatives?
Thanks!
You can use jmap
to take a memory sample (aka a heap dump). The command below creates a file
heap.hprof
in the current directory.
jmap -dump:format=b,file=heap.hprof <pid>
Once you have the sample you can transfer it to another machine for analysis with whatever tools you like. I recommend Memory Analyzer.
It depends on what type of sampling you want. jmap
console tool (from JDK bin folder) allows some kind of memory dumping etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With