title: How to understand top and htop results for tomcat with java threads
body: <p>Using <code>htop</code> and <code>atop</code> commands show that Java eats much CPU. Here are <code>htop</code> results:</p>
  
  <p><a href="https://i.stack.imgur.com/Ypsxm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ypsxm.png" alt="enter image description here"></a>.</p>
  
  <p>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%</p>
  
  <p>But when I run <code>top -H -p 17649</code>, then I see:</p>
  
  <p><a href="https://i.stack.imgur.com/dxzsm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dxzsm.png" alt="enter image description here"></a></p>
  
  <p>And there isn't any java thread with high CPU usage.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How to find LWP (light process id) to map it to <code>jstack</code> output?</li>
  <li>Do <code>htop</code> results mean that all CPU uses by Tomcat itself?</li>
  <li>Why <code>atop</code> or <code>ps -eLo pid,lwp,pcpu,vsz|grep  17649 |sort -n -k 3 -r |head -n 10</code> doesn't show thread with high CPU usage?</li>
  </ol>
  
  <p>Thanks.</p>