18

We recently upgraded from JDK6u20 (Linux, 32bit and 64bit) to JDK6u23. Since then, we cannot longer use the tools jstack and jstat to get monitoring information from the running process. If we switch back to JDK6u20, everything works fine.

We are running Tomcat 6. According to this forum post, others have the same problem: http://forums.oracle.com/forums/thread.jspa?threadID=2151967&tstart=0

Running simple plain Java processes and using the tools works.

Jstack says: 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.

Jstat says: 19799 not found

Using Jps does not show the running processes at all, so I guess the problem is more of general nature with JDK6u23 and also JDK6u24. It has a new Hotspot engine. Maybe something does not work in conjunction with Tomcat and that Hotspot v19.

Any idea? Help is appreciated.

P.S. Of course, we run that as the same user and we have not changed anything else. Only the JDK.

2
  • weird, never had issues w/ jstack, have you tried just jstack <pid> (no options)?
    – bestsss
    Mar 3, 2011 at 22:30
  • Yes, we tried only that and it did not work. But see below, found it. It is something that changed in the JDK and when having Tomcat in place, it becomes a problem.
    – ReneS
    Mar 4, 2011 at 14:33

2 Answers 2

12

Found a possible answer in the Oracle forum:

While it's true that 6u23/24 introduce this issue, it's not a bug in jps. Rather a change in behavior of the VM itself. On GNU/Linux Jps and the likes seem to only look at /tmp but not necessarily your CATALINA_TMPDIR. If set or not, try to export CATALINA_TMPDIR=/tmp which translates to "-Djava.io.tmpdir=/tmp" and after restarting the Tomcat process you should see Tomcat's data as "/tmp/hsperfdata_/" and Jps will most likely work again as well.

2
  • This is the answer. It works. Just tried it. But is hard to make it work when you relied on CATALINA_TMPDIR so far, because with a lot of services running, you might end up with conflicts in /tmp.
    – ReneS
    Mar 4, 2011 at 14:29
  • 3
    I fixed this by passing in the location of catalina's temp directory to JPS and so on: jps -J-Djava.io.tmpdir=/opt/tomcat/instances/solr/temp
    – mogsie
    Mar 20, 2011 at 10:02
4

See jps returns no output even when java processes are running for an instruction how to tell jps or jstat to connect to Tomcat's temp-dir

1
  • Thanks for the link. We will take this into account when fixing our setup.
    – ReneS
    Mar 9, 2011 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.