4

I'm starting tomcat from inside netbeans. I'd like to monitor the heap usage on that instance of tomcat so I fire up jVisualVM. However the process isn't listed. Any ideas?

Karthik Ramachandran
  • 11,925
  • 10
  • 45
  • 53

1 Answers1

6

Are you using Java version 6u24? Then you may fall victim to this bug which will be fixed in 6u25 (in a nutshell, jVisualVM can't find your process' hsperfdata).

Otherwise, you have to enable monitoring via JMX:

Pass the following JVM parameters to Tomcat:

-Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

Then add the remote process to jVisualVM via File -> Add JMX Connection. You can connect to the process using port 8888

jVisualVM has some other gotchas, e.g. the user starting jVisualVM needs to be the same as the user owning the process you want to monitor (although, I don't think this is your issue). See more here.

opyate
  • 5,388
  • 1
  • 37
  • 64