我们正在使用Hazelcast分布式对象,即IMap通过IMap.trylock()API进行锁定。我们必须为每个剩余呼叫获取并释放一个锁。我们观察到对我们的休息电话有重大影响。在线程转储分析中,我们看到大部分时间都花在LockSupport.park()上,如以下不同线程中所述
"qtp1073885358-4211" - Thread t@4211
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:304)
at com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:161)
at com.hazelcast.concurrent.lock.LockProxySupport.tryLock(LockProxySupport.java:138)
at com.hazelcast.map.impl.proxy.MapProxyImpl.tryLock(MapProxyImpl.java:483)
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:304)
at com.hazelcast.internal.util.concurrent.MPSCQueue.takeAll(MPSCQueue.java:231)
at com.hazelcast.internal.util.concurrent.MPSCQueue.take(MPSCQueue.java:153)
at com.hazelcast.spi.impl.operationservice.impl.InboundResponseHandlerSupplier$ResponseThread.doRun(InboundResponseHandlerSupplier.java:283)
at com.hazelcast.spi.impl.operationservice.impl.InboundResponseHandlerSupplier$ResponseThread.run(InboundResponseHandlerSupplier.java:272)
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:304)
at com.hazelcast.internal.util.concurrent.MPSCQueue.takeAll(MPSCQueue.java:231)
at com.hazelcast.internal.util.concurrent.MPSCQueue.take(MPSCQueue.java:153)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationQueueImpl.take(OperationQueueImpl.java:85)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.run(OperationThread.java:105)
这些呼叫消耗大量时间。有人遇到过类似的问题吗?以及什么可能解决?