在mac上使用jmap

编程入门 行业动态 更新时间:2024-10-24 22:30:05

在<a href=https://www.elefans.com/category/jswz/34/1771250.html style=mac上使用jmap"/>

在mac上使用jmap

在mac上执行命令jmap -heap 96530
报错:

Attaching to process ID 96530, please wait...
ERROR: attach: task_for_pid(96530) failed: '(os/kern) failure' (5)
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.execute(BsdDebuggerLocal.java:169)at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach(BsdDebuggerLocal.java:287)at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:671)at sun.jvm.hotspot.HotSpotAgent.setupDebuggerDarwin(HotSpotAgent.java:659)at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:341)at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:49)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at sun.tools.jmap.JMap.runTool(JMap.java:201)at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach0(Native Method)at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.access$100(BsdDebuggerLocal.java:65)at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1AttachTask.doit(BsdDebuggerLocal.java:278)at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.run(BsdDebuggerLocal.java:144)


原来是jdk(mac版)的bug:
.do?bug_id=8160376

升级成最新版jdk试试:

依然不管用。

还一不小心把~/.zshrc文件给改坏了,iterm2无法启动。在访达界面,按住“Command + Shift + . ”,显示隐藏文件。

看到隐藏文件,用文本编辑app打开.zshrc,即可编辑。

言归正传,jmap -heap pid,这bug就一直存在?在mac上这命令算不算是弃用了呀?

更多推荐

在mac上使用jmap

本文发布于:2023-11-15 16:56:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603083.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:mac   jmap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!