0

I tried to capture the tomcat process dump with jmap , however I got the error " Insufficient memory or insufficient privileges to attach" , obviously there is enough memory, and the currently login user is in the role local administrator group. If I run the cmd command as administrator, it still failed.

C:\Program Files\Java\jdk1.7.0_71\bin>jmap.exe -dump:format=b,file=d:\temp\HeapD
ump.hprof 30452
30452: Insufficient memory or insufficient privileges to attach
The -F option can be used when the target process is not responding
Catchwa
  • 5,845
  • 4
  • 31
  • 57
Jason
  • 1,115
  • 14
  • 25
  • Have you tried using the -F option? Are you running jmap as the same user as Tomcat? – Catchwa Nov 02 '16 at 03:11
  • 1
    I see that error before in tomcat. see this http://stackoverflow.com/questions/20149635/java-jstack-tool-insufficient-memory-or-insufficient-privilege-to-attach – Kenry Sanchez Nov 02 '16 at 03:25
  • Possible duplicate of [Jstack and Not enough storage is available to process this command](http://stackoverflow.com/questions/906620/jstack-and-not-enough-storage-is-available-to-process-this-command) – Vadzim Apr 13 '17 at 18:08

1 Answers1

2

I ran into a similar scenario where we were running a jetty server wrapped as a windows service and I wanted to take a memory dump of it. I think most of the answers elsewhere on SO deals with situations where the process you want to take a dump of is not running as a windows service. This link helped.

Download PsExec and run jmap like this:

<path to psexec>PsExec.exe -s "C:\Program Files\Java\jd k1.8.0_131\bin\jmap.exe" -dump:file=<filename> <processid>