ScheduledExecutorService CPU Spikes to 100% Due to Thread Pool Bug

When using ScheduledExecutorService with a core pool size of 0, a JDK bug can cause CPU usage to spike to 100%. This occurs due to an infinite loop in the getTask method of ThreadPoolExecutor when keepAliveTime is set to 0 nanoseconds. Problem Demonstration public static void main(String[] args) { ScheduledExecutorService executor = Executo ...

Posted on Thu, 04 Jun 2026 19:18:20 +0000 by skhale