我正在使用-XX:+PrintGCApplicationStoppedTime
和-XX:+PrintGCApplicationConcurrentTime
选项来开启垃圾回收日志记录。
但只有在打印了 4 或 5 次 PrintGCApplicationStoppedTime
后,我才能通过 -XX:+PrintGCDetails
命令打印出实际的 gc 日志细节!
按定义,PrintGCApplicationStoppedTime
会为每个 gc 打印应用程序停止时间。
但我不清楚为什么它会像下面的示例一样打印。
这是因为
PrintGCApplicationStoppedTime
只是在到达每个安全点后才打印
(还是)
日志文件将由不同的 gc 线程记录。 我正在使用 Concurrent sweep 进行完整的 GC 和 ParNew 进行年轻代 GC。
我的应用程序是 Web 应用程序。
输出模式- 我得到的结果是这样的:
Application time: 0.3847031 seconds
Total time for which application threads were stopped: 0.3135419 seconds
Application time: 0.1520723 seconds
Total time for which application threads were stopped: 0.1993920 seconds
Application time: 0.1188219 seconds
Total time for which application threads were stopped: 0.1993920 seconds
Application time: 0.1188219 seconds
Total time for which application threads were stopped: 0.1993920 seconds
Application time: 0.1188219 seconds
Total time for which application threads were stopped: 0.1993920 seconds
Application time: 0.1188219 seconds
1.229: [GC 1.229: [ParNew: 256000K->51200K(256000K), 0.1509756 secs] 426536K->334728K(997376K), 0.1510198 secs] [Times: user=0.85 sys=0.07, real=0.15 secs]