首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从HashiCorp Nomad运行的java应用程序中获得堆转储?

问如何从HashiCorp Nomad运行的java应用程序中获得堆转储?
EN

Stack Overflow用户
提问于 2017-06-08 11:03:38
回答 1查看 2.1K关注 0票数 1

我有由HashiCorp Nomad运行的java应用程序。在进程状态输出时,root运行游牧民执行程序进程,nobody运行java应用程序进程。

当我尝试执行命令:jmap -dump:format=b,file=filename.bin <app_pid>

我收到消息:

Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding

当我尝试执行命令:jmap -dump:format=b,file=filename.bin <app_pid> -F

我有下一个线索:

Attaching to core -F from executable 5584, please wait... Error attaching to core file: cannot open binary file sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method) at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286) at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:673) at sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:611) at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:337) at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304) at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156) at sun.jvm.hotspot.tools.Tool.start(Tool.java:191) at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118) at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83) 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)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-08 13:55:58

没有jmap的-F应该由与目标Java相同的用户运行(在您的例子中是nobody)。

jmap -F应该由root运行,而-F参数应该在<app_pid>之前运行。

代码语言:javascript
复制
jmap -dump:format=b,file=filename.bin -F <app_pid>

请参阅this answers中的详细信息。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44433945

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档