Thursday, January 10, 2013

VisualVM notes and tcServer


Over the years I have had to use visualVM every one in a while in order to help monitor a running application, or help isolate some problem, or generate a thread dump (eg. for a remote running application server)

Heres some notes on my experiences.

1/ Where is it.
VisualVM is located in your JVM (1.6 rel 7 and above).. Note filename is jvisualvm in the jdk/bin fir, e.g. $JAVA_HOME/bin/jvisualvm

2/ When running locally it shoudl immediately list all jvms running.
One case where I didn't see this happening was when testing a tcServer instance. This was launched via the wrapper.exe prog (to turn it into a service).

In orer to conenct to these you simply have to point at the JMX port.
This can  be found in the server.xml in the conf folder on tcServer. There should be a configuration for a listener e.g.
              authenticate="true"
              bind="127.0.0.1"
              className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener"
              passwordFile="${catalina.base}/conf/jmxremote.password"
              port="${base.jmx.port}"
              useSSL="false"/>


In my case the $base.jmx.port was specified in the catalina.propeties
base.jmx.port=21069

Conencting was simply a case of right clicking and entering localhost:21069 as the jmx connection url.

Login credentials are required. Again these are configured via the listener in the  server.xml above. In my case it was using the default values of admin/ springsource

No comments: