ParallelGCFailedAllocation 的大“同步"值 [英] Large 'sync' value for ParallelGCFailedAllocation
问题描述
有时我会在我的 gc.log 中看到长时间的停顿
Sometimes I see long pauses in my gc.log
2014-07-18T18:42:26.137+0400: 7846.980: [GC [PSYoungGen: 86267K->10032K(87744K)] 251198K-175254K(272512K), 0.0066190 秒] [时间: 用户=0.08 系统, 实数=0.01 秒]
2014-07-18T18:42:26.137+0400: 7846.980: [GC [PSYoungGen: 86267K->10032K(87744K)] 251198K-175254K(272512K), 0.0066190 secs] [Times: user=0.08 sys=0.00, real=0.01 secs]
应用程序线程停止的总时间:0.6394170秒
Total time for which application threads were stopped: 0.6394170 seconds
应用程序线程停止的总时间:0.0014570 秒
Total time for which application threads were stopped: 0.0014570 seconds
但这些暂停不会影响 GC 时间和 CPU 使用时间.
But these pauses don't affect GC time and CPU usage time.
安全点统计(+XX:PrintSafePointStatistics):
Safepoint statistics (+XX:PrintSafePointStatistics):
vmop [threads: total initial_running wait_to_block] [time: spin block sync cleanup vmop] page_trap_count7846.348:ParallelGCFailedAllocation [370 0 2] [0 0 630 1 7] 0
vmop [threads: total initially_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 毫秒)在这种情况下,同步"是什么意思?
(sync time = 630ms) What does 'sync' mean in this context?
推荐答案
sync
这里是到达安全点所花费的总时间.换句话说,就是从安全点请求到所有可运行的 Java 线程最终被阻塞的那一刻之间的延迟.
sync
here is the total time spent to reach a safepoint. In other words, it is the latency between the safepoint request and the moment when all runnable Java threads are finally blocked.
由于以下原因之一,安全点同步有时可能需要很长时间:
The safepoint synchronization may sometimes take too long due to one of the following reasons:
- 应用程序没有获得足够的 CPU 时间,因为操作系统正忙于密集的磁盘 I/O,或者当它开始交换时,或者当另一个高优先级进程占用所有 CPU 时间时.
- 一些 Java 线程执行长时间的不可中断操作,例如使用
System.arraycopy()
、clone()
、ByteBuffer.get()
等复制大量数据. MappedByteBuffer
I/O.
- The application does not receive enough CPU time because the OS is busy with intensive disk I/O or when it starts swapping or when another high-priority process takes all CPU time.
- Some Java thread performs long non-interruptible operation, e.g. copies large amount of data using
System.arraycopy()
,clone()
,ByteBuffer.get()
etc. MappedByteBuffer
I/O.
要记录在 500 毫秒内无法在安全点上阻塞的线程的名称,请使用
To log the names of the threads that could not get blocked on a safepoint in 500 ms use
-XX:+SafepointTimeout -XX:SafepointTimeoutDelay=500
这篇关于ParallelGCFailedAllocation 的大“同步"值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!