Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JVisualVM for Linux console?

Tags:

java

visualvm

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!

like image 363
Rocky Pulley Avatar asked Oct 01 '13 14:10

Rocky Pulley


2 Answers

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.

like image 107
Dev Avatar answered Sep 27 '22 23:09

Dev


It depends on what type of sampling you want. jmap console tool (from JDK bin folder) allows some kind of memory dumping etc.

like image 42
Rodion Gorkovenko Avatar answered Sep 27 '22 22:09

Rodion Gorkovenko