Getting "Unable to open socket file" message when executing jstack / jmap / jcmd and unable to generate a thread dump / heap dump

Solution Verified - Updated -

Issue

  • Got the following "Unable to open socket file: target process not responding or HotSpot VM not loaded" when executing jstack command and unable to generate a thread dump:

    [root@myhost /tmp]# jstack -l <JAVA_PID>
    <JAVA_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
    
  • Got the following "Unable to open socket file: target process not responding or HotSpot VM not loaded" when executing jmap command and unable to generate a heap dump:

    [root@myhost /tmp]# jmap -dump:format=b,file=heap.hprof <JAVA_PID>
    <JAVA_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
    
  • Same error was thrown when executing jcmd <JAVA_PID> GC.heap_dump -all=true FILENAME.hprof

  • Got the above message when executing jmap -histo:live <PID> command.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
  • JDK

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.