JDK-8149460 : jmap give unrelated error message if non java process id is specified in the command.
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86
  • Submitted: 2016-02-09
  • Updated: 2019-02-22
  • Resolved: 2019-02-22
Related Reports
Relates :  
Description
shafi@shafi-ahmad:$ ps -aef | grep firefox
shafi    23675   864 70 17:16 ?        00:00:05 /usr/lib/firefox/firefox
shafi    23750  2173  0 17:16 pts/1    00:00:00 grep --color=auto firefox

Above command shows firefox is running with pid 23675. I used this non java process id in the jmap command line.

shafi@shafi-ahmad:$ jmap -dump:live,format=b,file=heap_dump.hprof 23675
23675: 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

Error message "The -F option can be used when the target process is not responding" mislead the users.
Comments
The confusing mention was removed in an earlier code change to decouple SA from tmtools.
22-02-2019

The SA force option was removed with JDK-8155091.
20-02-2019

If you run with -XX:-UsePerfData to disable performance data, jps cannot see the process, but you can still use the attach framework (like jmap and jcmd does) to interact with the process.
11-02-2016

Not sure but can we use 'jps' for verification of the specified pid if 'jps' is present on the system Or we can use the 'jps' implementation itself inside the jmap if it is feasible.
10-02-2016

It's not trivial to know if a process is a java process or not, so not easy to fix.
10-02-2016