0

I'm in the process of learning how to use the visualVM utility. Started the Tomcat server in Eclipse IDE and tried getting a hang of the utility and the various options I could use to improve the performance of my application.

For this particular thread - ContainerBackgroundProcessor[StandardEngine[Catalina]], under the Threads Tab, I can see a running value of 653,760 ms.

For the same thread, under the Sampler -> CPU tab, I can see the Thread CPU Time [ms] as 710,409.

Why are these values different? Shouldn't they be the same? Also, what does the Thread CPU Time [ms]/sec represent?

Amit
  • 23
  • 6
  • The other one is wall clock time, the other time is the actual time used on the CPU to do something besides just waiting. – Kayaman Mar 03 '17 at 12:26
  • @kayaman Can you be clear which one is which? I'm getting confused :) – Amit Mar 03 '17 at 12:33
  • Well, take a wild guess which one is the one that has `CPU` in it? – Kayaman Mar 03 '17 at 12:38
  • Okay, I want to make this a little less complicated for myself since I'm new to these terminologies. So the running value of 653,760 ms implies that the Thread has been in the running state for this many milliseconds(wall clock). And the Thread CPU Time[ms] shows a value of 710,409 ms implies what? – Amit Mar 03 '17 at 12:45
  • Okay, I mixed up the two. I just closed and opened the Tomcat process in visualVM again and now i notice this - Running time under Threads Tab for the same thread is 25,423 ms while the Thread CPU Time (ms) is 755,121. Why is the difference so huge? – Amit Mar 03 '17 at 12:53
  • Ah, sorry. You're looking at the running results of the sampler instead of examining a snapshot (which is a lot easier way to examine what's going on). The Thread CPU Time tab could be useful for checking starved threads, otherwise snapshots are easier to examine. – Kayaman Mar 03 '17 at 12:54

0 Answers0