views:

1057

answers:

2

When monitoring a remote app (using jstatd) I can neither profile nor monitor cpu consumption. Heap monitoring (provided I do not use G1) works. jvisualvm provides the message "Not supported for this JVM." in the CPU graph window.

Is there anything missing in my setup? The google showed up next to no results.

The local environment (Mac OS X 10.6):

java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)

The remote environment (Linux version 2.6.16.27-0.9-smp (gcc version 4.1.0 (SUSE Linux))):

java version "1.6.0_16" Java(TM) SE
Runtime Environment (build
1.6.0_16-b01) Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

Local monitoring works as advertised.

A: 

Is it because the remote version is (albeit slightly) greater than the local version?

Rich
+4  A: 

Remote profiling of code and allocation isn't supported by Visual VM. This sucks, however if you want to enable the CPU graph you can do this by enabling JMX with

-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=12345

You may need to add some authentication settings too based on your network. The JMX settings will give you the CPU usage, and thread state, as well as doing a remote jstack.

A list of features for the remote version can be found here: Visual VM features

EDIT Get the latest version of visual vm 1.2.1 and download the VisaulVM-Sampler. This will read from a JMX connection to show the profiling information.

reccles
yawn
Followup: JMX in 1.6 has security enabled by default. For development one might want to disable security, see http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#no_security
yawn