2

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.

Max Grigoriev
  • 1,021
  • 2
  • 13
  • 29
  • I don't think "top -H" shows all threads by default, when run in interactive mode, although I guess it might be possible to make it do so. Still, it's possible that you're not seeing the thread with high CPU because it's simply not on screen. Perhaps try "top -H -p XXX -b -n 1". On Linux, the "nid" attribute in jstack should correspond to the process ID. – Kevin Boone Sep 06 '17 at 08:42

0 Answers0