我在我的应用程序上运行了负载测试,以找到支持计划负载所需的最大线程数.
我已经使用过,ExecutorService CachedThreadPool所以线程是根据负载动态创建的.现在我知道使用最大线程数的值getLargestPoolSize().
ExecutorService
CachedThreadPool
getLargestPoolSize()
我应更换CachedThreadPool同FixedThreadPool(maxValue),以避免大量(Integer.MAX_VALUE)的线程创建的行为CachedThreadPool?
FixedThreadPool(maxValue)
(Integer.MAX_VALUE)
建议每个人的利弊.
java multithreading executorservice threadpoolexecutor
executorservice ×1
java ×1
multithreading ×1
threadpoolexecutor ×1