Reputation: 8985
I'm attempting to profile a Java 7 application executed using mvn jetty:run
with VisualVM 1.3.6. The CPU shows as unavailable, and the profile tab lists the following error:
WARNING! Class sharing is enabled for this JVM. This can cause problems when profiling the application and eventually may crash it. Please see the VisualVM Troubleshooting Guide for more information and steps to fix the problem: https://visualvm.java.net/troubleshooting.html#xshare.
I am able to profile any other application normally.
The VisualVM log shows the following error a number of times:
java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded
Potentially relevant details:
I can presume the downvotes are related to the fact that there is a documented bug related to this issue with advice to set Xshare:off
, I'll include this link to the bug report, which lists it as fixed after 1.6u6. I am running 1.7u25, so this does not apply to me.
Upvotes: 10
Views: 3247
Reputation: 613
For Mac try passing these VM args: -Xverify:none -Xshare:off
If you're working with JConsole and other JMX Tools also include:
-Xcom.sun.management.jmxremote
Found via: http://brian.pontarelli.com/2009/10/21/fixing-java-tools-on-snow-leopard/
Upvotes: 15
Reputation: 91
on Mac, trying to profile web app in Tomcat and running JDK 1.7, I had to add the -Xverify:none flag to avoid "the Unable to open socket file: target process not responding or HotSpot VM not loaded" error message.
Upvotes: 2
Reputation: 31087
The link you include in your question (https://visualvm.java.net/troubleshooting.html#xshare) has some advice:
There is a known problem with dynamic attach which is used for profiling, it may cause target JVM to crash when class sharing is enabled. To start an application without class sharing, provide -Xshare:off argument to the java command starting the application.
Upvotes: 1