Java 生产中为什么不推荐使用Executors而推荐使用ThreadPoolExecutor?
问题引出阿里巴巴开发手册并发篇中,有这么一段话,严格规范线程池创建方式只能使用ThreadPoolExecutor。那么这是为什么呢?原因分析如图所示,FixedThreadPool和SingleThreadExecutor创建都是使用LinkedBlockingQueue,LinkedBlockingQueue最大长度为Integer.MAX_VALUE,队列中可能堆积大量的请求而导致OOM。CachedThreadPool和ScheduledThreadPool默认允许最大线程数也是Inte