David
David

Reputation: 177

JMap with JVM Debugging Disabled

Can I use jmap to create a java memory heap on a JVM which was started with debugging disabled? If so, how?

Upvotes: 2

Views: 953

Answers (2)

(You know about visualvm and that it can connect to a running Java process? Requires Sun Java 6)

Upvotes: 2

dogbane
dogbane

Reputation: 274612

To use jmap you just need a JVMID, which is the process identifier of the JVM you want to dump.

First use jps to get the JVMID. Then use jmap to dump the heap to a file.

Example:

jmap -dump:format=b,file=heap.bin <JVMID>

Upvotes: 4

Related Questions