简体   繁体   English

捕获tomcat转储时出现“内存不足或特权不足”

[英]“Insufficient memory or insufficient privileges to attach ” when capture the tomcat dump

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. 我尝试使用jmap捕获tomcat进程转储,但是出现错误“内存不足或没有特权附加”,显然有足够的内存,并且当前登录的用户位于本地管理员组中。 If I run the cmd command as administrator, it still failed. 如果以管理员身份运行cmd命令,它仍然会失败。

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

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. 我遇到了类似的情况,我们正在运行一台作为Windows服务包装的码头服务器,我想对其进行内存转储。 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. 我认为SO上其他地方的大多数答案都涉及您要转储的进程未作为Windows服务运行的情况。 This link helped. 链接有所帮助。

Download PsExec and run jmap like this: 下载PsExec并按以下方式运行jmap:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM