背景:我们在垃圾收集方面遇到了一些问题,我们发现它需要 15-40 秒,在此期间应用程序处于“暂停”状态。
以下是我们在垃圾收集日志中看到的内容‘时间:用户 = 0.04 系统 = 0.00,实际 = 14.54 秒’
事实上,用户/系统时间非常小而实际时间很大,(我认为)这意味着垃圾收集行为只花费了一小段时间,但由于某种原因,应用程序正在等待线程到达安全点。我们设法在其中一次暂停期间获得了线程转储,我希望有人可以解释一下我在这里看到的内容:
"AsyncAppender-Worker-JVM_ASYNC" #25 daemon prio=5 os_prio=0 tid=0x00007fd8daaa5800 nid=0x4ed5 waiting on condition [0x00007fd90abf2000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c1876d30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObje
"RMI RenewClean-[10.12.113.3:40608]" #21 daemon prio=5 os_prio=0 tid=0x00007fd83401c800 nid=0x4ed2 in Object.wait() [0x00007fd90aff4000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
- locked <0x00000000c18b23a8> (a java.lang.ref.ReferenceQueue$Lock)
at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
at java.lang.Thread.run(Thread.java:745)
"RMI Reaper" #17 prio=5 os_prio=0 tid=0x00007fd8dbfb0000 nid=0x4ece in Object.wait() [0x00007fd90b7f6000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c0002d00> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
- locked <0x00000000c0002d00> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
at java.lang.Thread.run(Thread.java:745)