Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 8, 2025 · Backend Development

Why Java ThreadPoolExecutor’s Core Threads Aren’t Recycled by Default

In Java’s ThreadPoolExecutor, core threads remain alive even when idle unless the allowCoreThreadTimeOut flag is set to true, which then permits both core and non‑core threads to be reclaimed after exceeding the keepAliveTime threshold, a behavior that contradicts the pool’s design principle of minimizing thread creation overhead.

JavaThreadPoolExecutorallowCoreThreadTimeOut
0 likes · 2 min read
Why Java ThreadPoolExecutor’s Core Threads Aren’t Recycled by Default