![]() Previous |
![]() Next |
The profiled application needs to enable the HotSpot JVM DTrace probes with the following JVM flags:
-XX:+DTraceMonitorProbes -XX:+ExtendedDTraceProbes
When later selecting which java process to profile, you will only be able to see the pid and the first part of the command line, a tip to be able to recognize your application is to add a dummy property in the beginning of your command line. For example:
<JAVA_HOME>/bin/java -Ddummy=java2demo -XX:+DTraceMonitorProbes -XX:+ExtendedDTraceProbes -jar <JAVA_HOME>/demo/jfc/Java2D/Java2Demo.jar -runs=100 -delay=5
You need to run the DTrace recorder server and the profiled application as the same user.
It is possible (but not recommended) to run the DTrace Recorder server as root, and the profiled application as a normal user, although the DTrace recording can lack information about thread names.