Why is CPU time greater than wall clock time in VisualVM?

Viewed 149

When profiling with VisualVM, a CPU time lower than the wall clock time can be caused by cache misses (=waiting for memory access), blocked threads, or even the OS deciding that something else is more important.

But how should I interpret the opposite, if CPU time is actually higher than wall clock time? My first guess is parallelization, but my code is single-threaded. Does JIT parallelize? I use OpenJDK 11.

I have several examples of this in my code, below is just one: Profiler snapshot

1 Answers

I don't know what the real cause of this anomaly is. However:

  1. Current generation HotSpot JITs do not automatically parallelize code as they compile it. (AFAIK)
  2. A LinkedList.removeFirst() operation is not automatically parallelizable anyway.

So I think we can exclude that as a possible explanation.

Related