3,200% CPU Utilization
Published on: 2025-07-10 03:01:43
A while back my machine was so messed up that I could barely ssh onto it. 3,200% CPU utilization - all 32 cores on the host were fully utilized! Compare that to my last bug where it only used 1 core, 100%
Fortunately, it was using Java 17 runtime which had thread dumps with CPU time! Sorting by CPU time brought a bunch of threads that looked similar to this:
"Thread-0" #22 [14700] prio=5 os_prio=0 cpu=10359.38ms elapsed=11.49s tid=0x000001cdc35aaf60 nid=14700 runnable [0x00000047cfffe000] java.lang.Thread.State: RUNNABLE at java.util.TreeMap.put([email protected]/TreeMap.java:826) at java.util.TreeMap.put([email protected]/TreeMap.java:534) at BusinessLogic.someFunction(BusinessLogic.java:29) ...
I make a quick conclusion about this and thought to look at BusinessLogic:29 based on the stack trace and it looked like this:
public void someFunction ( SomeType relatedObject , List < SomeOtherType > unrelatedObjects ) { ... for ( SomeOtherType unrelatedObject : unrelatedObjects ) { treeMa
... Read full article.