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

强颜欢笑 提交于 2019-12-10 12:44:28

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/5491340/what-the-difference-between-time-and-timecpu-in-visualvm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!