[java] How to get a thread and heap dump of a Java process on Windows that's not running in a console

How to get process id of java application?

Execute the command 'jcmd' to get the process id of java applications.

How to get Thread dump?

jcmd PID Thread.print > thread.dump

Reference link

You can even use jstack to get thread dump (jstack PID > thread.dump). Reference link

How to get heap dump?

Use jmap tool to get heap dump. jmap -F -dump:live,format=b,file=heap.bin PID

PID stands for process id of the application. Reference link

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to jvm

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 How can I get a random number in Kotlin? Kotlin unresolved reference in IntelliJ Is JVM ARGS '-Xms1024m -Xmx2048m' still useful in Java 8? Android Gradle Could not reserve enough space for object heap Android java.exe finished with non-zero exit value 1 Android Studio Gradle project "Unable to start the daemon process /initialization of VM" Android Studio - No JVM Installation found Android Studio error: "Environment variable does not point to a valid JVM installation" Installing Android Studio, does not point to a valid JVM installation error

Examples related to heap-dump

How can I analyze a heap dump in IntelliJ? (memory leak) how to increase java heap memory permanently? How to get a thread and heap dump of a Java process on Windows that's not running in a console

Examples related to thread-dump

How to get a thread and heap dump of a Java process on Windows that's not running in a console