keepAliveTime
keepAliveTime is a configuration parameter used by thread pool implementations to determine how long idle worker threads may remain alive before being terminated. It helps balance responsiveness and resource usage by allowing the pool to shrink during quiet periods while retaining a ready set of threads for bursts of work. The concept is tightly related to the core pool size and the maximum pool size.
In typical thread pool designs, there are core threads and non-core threads. Core threads are kept alive
The value of keepAliveTime is specified with a time unit, such as seconds or minutes. In Java's
Practical guidance: a shorter keepAliveTime reduces idle resource usage but may increase thread churn during bursts;