Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Doc: ThreadPoolTaskExecutor's defaults vs setting queueCapacity for common pool scenarios [SPR-16944] #21483
According to ThreadPoolExecutor Javadoc:
"If there are more than corePoolSize but less than maximumPoolSize threads running, a new thread will be created only if the queue is full."
In the class ThreadPoolTaskExecutor the default values are: 1 for the corePoolSize and Integer.MAX_VALUE for maxPoolSize and queueCapacity.
This means that a second thread will be created only when we have MAX_VALUE elements in the queue. This is is not reasonable.
I think queueCapacity should not have a default value.
Backported to: 4.3.19
Juergen Hoeller commented
Those defaults essentially mimic
Making the default
I'll therefore turn this into a documentation task, making those typical scenarios clearer.