Ubuntu下解决 jmap等jdk工具attach pid错误

前端之家收集整理的这篇文章主要介绍了Ubuntu下解决 jmap等jdk工具attach pid错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

http://blog.csdn.net/yhmhappy2006/article/details/7300019


1.错误案例

  1. nathan@ubuntu:~/Downloads$jmap-heap3991
  2. AttachingtoprocessID3991,pleasewait...
  3. Errorattachingtoprocess:sun.jvm.hotspot.debugger.DebuggerException:Can'tattachtotheprocess


2.解决方

1)修改/etc/sysctl.d/10-ptrace.conf文件如下:

< kernel.yama.ptrace_scope = 1
---
> kernel.yama.ptrace_scope = 0
(即将1改成0)
2)重启
3.成功



4.参考http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7050524

http://www.ryanchapin.com/fv-b-4-792/Error-attaching-to-process--sun-jvm-hotspot-debugger-DebuggerException--Can-t-attach-to-the-process--SOLVED-.html

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7050524
原文链接:https://www.f2er.com/ubuntu/355375.html

猜你在找的Ubuntu相关文章