0

I have a Application running under Tomcat .

I want to profile this Application (VisualVM ----> CPU Sampler), as part of that when i launched VisualVM under java bin directory

I was seeing the following Message

Class sharing is enabled for this JVM" warning is shown in red box in Profiler tab

Under the below link , the following resolution is mentioned

https://visualvm.java.net/troubleshooting.html

Resolution: 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.

Could anybody please let me know how to resolve this .

1 Answers1

0
$ export CATALINA_OPTS="-Xshare:off"
$ $CATALINA_HOME/bin/catalina.sh start

If you are using a Microsoft Windows service, run CATALINA_HOME/bin/tomcatXw.exe (where X is your Tomcat version) and edit the launcher arguments to include -Xshare:off.

Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77