Reduce the number of filler threads ... 8 threads is too many on a hyper threaded 4-core CPU.

pull/60/head
Brett Wooldridge 11 years ago
parent eeec5415c6
commit d7f7c111ce

@ -68,7 +68,7 @@ public final class PoolUtilities
}
};
int processors = Runtime.getRuntime().availableProcessors();
int processors = Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(queueSize);
ThreadPoolExecutor executor = new ThreadPoolExecutor(processors, processors, 10, TimeUnit.SECONDS, queue, threadFactory, new ThreadPoolExecutor.DiscardPolicy());
executor.allowCoreThreadTimeOut(true);

Loading…
Cancel
Save