Search code examples
javaprofilingvisualvmjvisualvm

Why does the "Total Time" column in visualvm differ from runtime duration?


I've been running the CPU Profiler in visualvm on my java process for 45 minutes, however the "Total Time" column shows only roughly 104,000ms elapsed (i.e. 104 seconds), and it grows but it grows slowly.

This clearly doesn't map to real physical time as I was expecting to see 45*60*1000 milliseconds elapsed (not 104*1000). What is it measuring?enter image description here


Solution

  • As the tooltip hover says "Time spent in all invocations on this method (including further method calls)". I.e. method specific wall-clock time, including calls done in the method.

    You can compare it with the total CPU time, to see how efficiently the time is being used processor-wise.