Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy to use performance and memory .NET profiler for Windows and Linux.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

Interpreting CPU profiling results with sleep and park

Moderators: Vladimir Kondratyev, Anton Katilin

Interpreting CPU profiling results with sleep and park

Postby jimfcarroll » Wed May 12, 2021 12:51 pm

I don't understand some of the profiling results I'm seeing. For example:

In a snapshot I see flames and 100% in [walltime] java.lang.Thread.sleep. Why is sleep being interpreted as CPU heavy.

Also, in the running threads view I see similar results for java.lang.Object.wait (100% with flames) and Unsafe.park. This makes it really difficult to sort out real users of the CPU from functions that are effectively not using it.

I do not have any -D options set post installing YourKit.
Posts: 1
Joined: Wed May 12, 2021 12:42 pm

Re: Interpreting CPU profiling results with sleep and park

Postby Anton Katilin » Wed May 12, 2021 1:28 pm

sleep() and others may be measured by default as wall time, please see the section "Configuring the settings" at https://www.yourkit.com/docs/java/help/ ... ttings.jsp

To change future measurements, use the preset "Measure CPU time for all methods" via "Use Preconfigured Settings".

To exclude method(s) in an already obtained snapshot, use https://www.yourkit.com/docs/java/help/cpu_what_if.jsp
Anton Katilin
Posts: 6062
Joined: Wed Aug 11, 2004 8:37 am

Return to Java Profiler

Who is online

Users browsing this forum: No registered users and 1 guest


YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.