2016-01-05 7 views
7

は、単純なタスク5秒ごとに実行しますScheduledThreadPoolExecutorの次のような構成である原因ScheduledThreadPoolExecutorは常に1つのCPUコアに100%の負荷を与えます。プール内の1つのスレッドがまだあるcorePoolSize = 1ScheduledThreadPoolExecutorのは、与えられた1つのCPUコアに100%負荷

"pool-1-thread-1" - Thread [email protected] 
    java.lang.Thread.State: RUNNABLE 
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

: は、スレッドダンプを調査すると、次のスタックトレースを明らかにする。しかし、スレッドは基本的には常に状態TIMED_WAITINGにあり、したがってアイドル状態です。

ScheduledThreadPoolExecutorの動作はcorePoolSize = 0と既知の機能、未確認の誤った設定、またはバグですか?

答えて

関連する問題