Is there any known command line tool to ask the JVM to see memory usage and thread dumps of a java program. something like a headless jvisualvm?
Asked
Active
Viewed 1.1k times
3 Answers
11
You can use jstat to get gc information, jstack to get stack traces and jmap to get memory statistics and memory dumps for off-line inspection.

Roger Lindsjö
- 11,330
- 1
- 42
- 53
-
@KaizenSoze Did you mean jhat? I mentioned jmap, but maybe you think I should add info about it? – Roger Lindsjö Feb 10 '12 at 08:14
1
Ctrl+Break will produce a thread dump and various statistics.
This is documented, along with kill -QUIT
, here.

Jonathon Faust
- 12,396
- 4
- 50
- 63