« Back

Unable to open socket file: target process not responding or HotSpot VM not loaded

When running Liferay Portal 6.0 EE SP1 + Tomcat 6.0.29, I found it impossible to take a heap dump to diagnose a memory leak. Firstly, jps wouldn't even list the process ID so I had to use ps instead:
 
$ jps
9745 Jps
 
Secondly, when creating the dump with jmap I always got the following error:
 
$ jmap -dump:file=dump.hprof 7642
7642: 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
 
The fix turned out to be somewhat unexpected. I simply had to remove the explicit declaration of the java.io.tmpdir system property from our Tomcat start-up script, i.e.:
 
-Djava.io.tmpdir=%CATALINA_BASE%/temp

Now both jps and jmap work fine:
 
$ jps
4916 Jps
4068 WrapperSimpleApp

$ jmap -dump:file=dump.hprof 4068
Dumping heap to /foo/bar/dump.hprof ...
Heap dump file created
Comments
Trackback URL:

No comments yet. Be the first.