Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I capture a Java heap dump in Windows?

Problem

You want to capture a heap dump of a Java process on Windows. You launch a command prompt with admin privileges and use "jmap," which is a command-line tool that prints memory-related statistics, but the command returns either an "Access Denied" error message or an "Insufficient Memory" or "Insufficient Privilege to attach" error message.

 

Examples:

 

rightfax_heapdump_cmd.png

 

 rightfax_heapdump_cmd1.png

 

Solution

If Java processes are running in the background, Windows does not allow jmap or jconsole tools to see JVM started as a Windows service. Instead of using jmap to capture a heap dump for a Java process on Windows, use the Microsoft tool PsExec to generate a heap dump.

 

Example: 

Screen Shot 2018-06-28 at 11.48.27 AM.png

 

Version history
Revision #:
7 of 7
Last update:
4 weeks ago
Updated by:
 
Labels (1)
0 Kudos