-->

Why does jProfiler show Unsafe.park/unpark as usin

2019-06-20 15:58发布

问题:

We're running a service using quite a lot of ExecutorServices.

When profiling the service using jProfiler 7.1 (sampling, Runnable), we can see that sun.misc.Unsafe.park + unpark is currently the calls using most of the CPU time in the hotspot.

http://i.stack.imgur.com/wT2Cj.jpg

This is puzzling.

Park and unpark should be blocking, hence not use any CPU cycles (or at least a low amount). Is this some sort of bug from the jprofiler (i.e. not detecting it, because it's in the sun.misc package?) or is there actually something wrong in our use of the ExecutorService framework?

回答1:

This is fixed in JProfiler 7.1.1. It could happen when you disconnected and reconnected to a profiled JVM.