How to understand top and htop results for tomcat with java threads

1.4k views Asked by At

Using htop and atop commands show that Java eats much CPU. Here are htop results:

enter image description here.

As I understood, the main Tomcat thread with PID=17649 takes 248% of all CPUs. And then other java threads created inside app take small amount of CPU like 4-3%

But when I run top -H -p 17649, then I see:

enter image description here

And there isn't any java thread with high CPU usage.

My questions are:

  1. How to find LWP (light process id) to map it to jstack output?
  2. Do htop results mean that all CPU uses by Tomcat itself?
  3. Why atop or ps -eLo pid,lwp,pcpu,vsz|grep 17649 |sort -n -k 3 -r |head -n 10 doesn't show thread with high CPU usage?

Thanks.

0

There are 0 answers