ParallelGCFailedAllocation的大"同步"值

dre*_*her 2 performance garbage-collection jvm

有时我会在gc.log中看到长时间停顿

2014-07-18T18:42:26.137 + 0400:7846.980:[GC [PSYoungGen:86267K-> 10032K(87744K)] 251198K-175254K(272512K),0.0066190 secs] [次:用户= 0.08 sys = 0.00,real = 0.01秒]

应用程序线程停止的总时间:0.6394170

应用程序线程停止的总时间:0.0014570秒

但这些暂停不会影响GC时间和CPU使用时间.

安全点统计(+ XX:PrintSafePointStatistics):

vmop [threads:total initial_running wait_to_block] [time:spin block sync cleanup vmop] page_trap_count 7846.348:ParallelGCFailedAllocation [370 0 2] [0 0 630 1 7] 0

(同步时间= 630毫秒)"同步"在这种情况下意味着什么?

apa*_*gin 7

sync这是达到安全点所花费的总时间.换句话说,它是安全点请求与最终阻止所有可运行Java线程之间的延迟.

由于以下原因之一,安全点同步有时可能需要很长时间:

  • 应用程序没有足够的CPU时间,因为操作系统忙于密集的磁盘I/O,或者当它开始交换或另一个高优先级进程占用所有CPU时间时.
  • 一些Java线程执行长的无中断操作,如使用拷贝大量的数据System.arraycopy(),clone(),ByteBuffer.get()等.
  • MappedByteBuffer I/O.

要在500毫秒的时间内记录无法在安全点上阻止的线程的名称,请使用

-XX:+SafepointTimeout -XX:SafepointTimeoutDelay=500
Run Code Online (Sandbox Code Playgroud)