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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content