Reputation: 105227
After successfully attaching VisualVM to a remote host I keep getting "Not supported for this JVM" label on the CPU panel, system properties, etc. Also, I don't seem to have access to the "Threads" panel, that I need in order to do thread dumps.
I've tried to run 32 and 64 bit versions of VisualVM, from both JDK7 and JDK8 (the target process is running on a Linux machine in 64 bits mode). The problem seems to be just the same in both cases for VisualVM configurations.
This is what java -version
gets me on that machine:
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
Is there anything I should take into special consideration or is there some kind of limitation when doing remote access?
Upvotes: 3
Views: 6628
Reputation: 24060
When you connect to a remote JVM the VisualVM will usually talk over the JMX interface to get the threads etc. However, the remote JVM decides what it will make available to the client, rather than everything being available by default; so it's possible that the JVM you're connecting to just doesn't support reporting on those characteristics.
Assuming that the connection works properly, you will find that there are various isXxxSupported
methods that the JVM's returning, possibly false in this case.
One thing you might like to try is to run jcmd
on the remote server (or jps
) to see if there's some kind of restriction on the processes in the box that are preventing you from seeing the other VMs as that user. It may be that if it's running in something like a container then the RMI calls for the JMX aren't being passed through, or if you're running in an selinux or a Java security policy that it's not letting you read/communicate on the network ports or files.
JMXServiceURL url = new JMXServiceURL("rmi", "", 0, "/jndi/rmi://" + host + ":" + port + "/jmxrmi");
JMXConnectionFactory factory = JMXConnectorFactory.connect(url);
MBeanSearverConnection conn = factory.getMBeanServerConnection();
ThreadMXBean threads = ManagementFactory.newPlatformMXBeanProxy(conn, ManagementFactory.THREAD_MXBEAN_NAME,ThreadMXBean.class);
long ids[] = threads.getAllThreadIds();
If you can get the thread IDs then it suggests you can talk to the server; there are other methods on the threads
that will allow you to get stack traces etc. This will be the method that's used by the VisualVM and may allow you to do further debugging as to what's going wrong on the responses.
Upvotes: 0
Reputation: 73578
It doesn't mean the JVM that you're using to run VisualVM when it says "Not supported for this JVM", it means the remote server's VM.
You're probably running a non-oracle VM there (openjdk probably) in which case VisualVM can't work properly. Either change to Oracle's JRE on the server, or get a profiler that can handle OpenJDK too.
Upvotes: 4