Q: 8071326: ThreadPoolExecutor in endless thread creation loop if workQueue.take() throws RuntimeException

Lev Priima lev.priima at oracle.com
Tue Jan 27 21:03:36 UTC 2015

Yes. And if we have BlockingQueue w/ some amount of tasks which fail 
with exceptions, same amount of threads(not limited by neither 
maximumPoolSize/corePoolSize) will hang under TPE which takes tasks from 
this queue.

It may cause problems if queue has a big percentage of exception-fail 
tasks and we eventually get OOME while unable to create new native thread.


On 01/27/2015 11:31 PM, Martin Buchholz wrote:
> On Tue, Jan 27, 2015 at 7:43 AM, Lev Priima <lev.priima at oracle.com 
> <mailto:lev.priima at oracle.com>> wrote:
>     And these thread will be cleaned only when whole TPE finished.
> Is this really true?  Each thread should be replaced while running and 
> so the total number of threads retained by the TPE at any one time 
> should be no more than core pool size.

More information about the core-libs-dev mailing list