简体   繁体   中英

JMC doesn't show hot methods and packages

I'm trying to find problem methods in my server program with JMC. When I run server locally (on Windows) and start Flight Recorder from JMC - all works fine. JMC properly shows data in Code tab: Hot Methods, Call Tree, etc But when I trying to profile server on remote platform (on Linux) I got empty window. To start JFR on platform I use this:

/opt/java/java8/bin/jcmd 38390 VM.unlock_commercial_features
/opt/java/java8/bin/jcmd 38390 JFR.start duration=10m compress=true filename=dxstress3_cross_try1.jfr settings=/opt/dxstress/settings_for_jmc.jfc

I use Oracle JDK 8u40 Settings file settings_for_jmc.jfc I exported from JMC. It contains execution_sample settings

<event path="vm/prof/execution_sample">
  <setting name="enabled">true</setting>
  <setting name="period">10 ms</setting>
</event>

空热方法窗口

Is there option to record or not such data? What did I miss?

Does it work if you don't specify a custom settings file?

If it does, the problem is most likely in your .jfc-file. It should look like this on JDK 7/8

 <event path="vm/prof/execution_sample"> 
   <setting name="enabled" control="method-sampling-enabled">true</setting>
   <setting name="period" control="method-sampling-interval">10 ms</setting>
 </event>

If not, it could be a bug. There was a problem with semaphores not using CLOCK_REALTIME on Linux, which could reduce the number of samples drastically. It was fixed in 7u80 and 8u25.

To print the currently used event settings do:

jcmd <pid> JFR.check verbose=true

If vm/prof/execution_sample is enabled, the problem lies in the JVM and the sampler. Otherwise, it is most likely in the configuration.

The sampler only creates events if the sampled method is running Java code, so if your application is spinning in native there will be no samples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM