Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file

infraio picture infraio · Aug 2, 2016 · Viewed 42.7k times · Source

When I use jmap to get the heap info about a process, I got error like that:

$jmap -heap process_id

Attaching to process ID process_id, please wait...
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: cannot open binary
file
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException:
cannot open binary file    

OS: Ubuntu 14.04

I have solved another error (DebuggerException: Can't attach to the process) by updating kernel.yama.ptrace_scope = 0.

See: https://bugs.openjdk.java.net/browse/JDK-7050524

Answer

hakish picture hakish · Nov 17, 2016

I faced the same issue, however when I su'd to the correct user having the relevant permissions the issue went away.