AppDynamics Knowledge Base

How do I capture a Java heap dump in Windows?

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:

image.png

 image.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: 

image.png

Labels (1)
Version history
Last update:
‎05-18-2017 10:12 AM
Updated by: