Core + max pool size

Core = always-alive workers. Max = grows to this under load. When queue is unbounded, max never triggers.

Advertisement

Core + max pool size

Core = always-alive workers. Max = grows to this under load. When queue is unbounded, max never triggers.

Advertisement

Queue choice matters

LinkedBlockingQueue = unbounded, workers = core. SynchronousQueue = no buffer, direct handoff, workers can grow to max.

Rejection policies

What happens when queue AND workers are full: AbortPolicy (throw), CallerRunsPolicy (submitter runs), DiscardPolicy (drop).

Timeout on non-core

Non-core workers die after idle time. Core workers stay. Configure allowCoreThreadTimeOut for elastic pools.

Common misconfigurations

Unbounded queue + fixed workers = OOM on burst. SynchronousQueue + low max = rejections. Match config to workload.