因此,如果我有2个服务,A和B.每个服务实现CuratorFramework,但访问相同的Zookeeper集群。
现在这些是春季启动应用程序。一旦我运行这些Spring启动应用程序,就会发出一些请求,在一段时间内我的服务开始抛出OutOfMemory:无法创建新的本机线程。所以我做了一个线程转储,我注意到以下内容:
Curator-ConnectionStateManager-0 - priority:5 - threadId:Curator-ConnectionStateManager-0 - state:WAITING
stackTrace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
org.apache.curator.framework.state.ConnectionStateManager.processEvents(ConnectionStateManager.java:245)
org.apache.curator.framework.state.ConnectionStateManager.access$000(ConnectionStateManager.java:43)
org.apache.curator.framework.state.ConnectionStateManager$1.call(ConnectionStateManager.java:111)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
任何人都可以帮助我,因为我不确定为什么这些线程在等待
谢谢,