Java 大量线程正在等待ForkJoinPool
我的java应用程序停止工作。在查看堆栈转储时,我发现有28个线程正在等待特定的线程。我在应用程序启动时使用newSingleThreadScheduledExecutor,并在应用程序关闭时停止它 我不知道如何从这里开始。这是问题的根本原因还是我遗漏了什么Java 大量线程正在等待ForkJoinPool,java,deadlock,jstack,Java,Deadlock,Jstack,我的java应用程序停止工作。在查看堆栈转储时,我发现有28个线程正在等待特定的线程。我在应用程序启动时使用newSingleThreadScheduledExecutor,并在应用程序关闭时停止它 我不知道如何从这里开始。这是问题的根本原因还是我遗漏了什么 “ForkJoinPool.commonPool-worker-29”#1326守护进程prio=5 os_prio=0 tid=0x00007ff8d8054000 nid=0x2644等待条件[0x00007ff87154a000] j
“ForkJoinPool.commonPool-worker-29”#1326守护进程prio=5 os_prio=0 tid=0x00007ff8d8054000 nid=0x2644等待条件[0x00007ff87154a000]
java.lang.Thread.State:等待(停车)
在sun.misc.Unsafe.park(本机方法)
-停车等待(java.util.concurrent.ForkJoinPool)
来自堆栈转储的Grep结果
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
- parking to wait for <0x00000000804e10c8> (a java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
-停车等待(java.util.concurrent.ForkJoinPool)
并行流操作使用ForkJoinPool
。您应该修改如何在流上使用parallel()
调用(并且-可能-重新考虑它,因为等待意味着阻塞或同步,而这两者都不应该在并行流中使用)。您是否可以显示相关的代码?“停止工作”是什么意思?ForkJoinPool的单线程执行器?