Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What the difference between Time and Time(CPU) in VisualVM

I was using VisualVM to find where all the time was being spent for a particular call. I found that most the time was in a database call, but the profier shows that 85% of the time was java.lang.Object and only 15% in the DB Call.

Am I reading something wrong?

The columns with data are Time, Time (CPU), Invocations. Profiler

like image 261
Brig Avatar asked Mar 30 '11 19:03

Brig


Video Answer


1 Answers

It looks like most of the time is spend in Object.wait(). The difference between Time and Time(CPU) is described in the tooltip for particular column. Time(CPU) is an approximation of real CPU usage, while Time is wall-clock time. So for Object.wait(), Time(CPU) is always zero, since it only waits and does not use CPU.

like image 64
Tomas Hurka Avatar answered Sep 21 '22 16:09

Tomas Hurka