I was profiling my application using JProfiler and as result, in "CPU Views" section it shows that more than 40% of CPU time is spent on Object.wait()
. However as far as I know on Object.wait()
CPU is not given to the waiting thread.
Could somebody help understand what's going on and why the profiler shows that this much of CPU is spent on Object.wait()
?
None. See above, but the CPU overhead used to manage the threads does not change based on the thread context.
Peripheral causes of high Java CPU usagebad JVM memory management; poorly configured Java GC; issues more correctly attributable to the software stack; thread synchronization, contention and deadlock issues; and.
The profiler does not know that the CPU is idle while in wait()
. All that the profiler knows is that wait()
was entered, and several milliseconds later it returned. So, if those milliseconds tend to take up 40% of your execution time, there you have it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With