简体   繁体   English

分析gc日志

[英]Analyzing gc logs

I am using -XX:+PrintGCApplicationStoppedTime and -XX:+PrintGCApplicationConcurrentTime options to turn on gc logging. 我正在使用-XX:+PrintGCApplicationStoppedTime-XX:+PrintGCApplicationConcurrentTime选项打开gc日志记录。

But found that only after 4 0r 5 prints of PrintGCApplicationStoppedTime my actual details of gc logs printed through -XX:+PrintGCDetails command! 但是发现只有在4 0r 5次打印PrintGCApplicationStoppedTime我的gc日志的实际详细信息才通过-XX:+PrintGCDetails命令打印!

By definition PrintGCApplicationStoppedTime prints application stopped time for every gc. 根据定义, PrintGCApplicationStoppedTime为每个gc打印应用程序停止时间。

But I am not clear why it prints like the example shown below. 但是我不清楚为什么它会打印如下所示的示例。

Is that because 是因为

PrintGCApplicationStoppedTime just prints after every safe point reach PrintGCApplicationStoppedTime仅在每个安全点到达后打印

(or) (要么)

the log file will be logged by different gc threads. 该日志文件将由其他gc线程记录。 Im using Concurrent sweep for full GC and ParNew for the young generation 我将并发扫描用于完整GC,并为年轻一代使用ParNew

My application is web application. 我的应用程序是Web应用程序。

O/p Pattern- Im getting like this: O / p模式-我变得像这样:

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]

Unfortunately PrintGCApplicationStoppedTime is misleading name for this JVM option. 不幸的是, PrintGCApplicationStoppedTime是此JVM选项的误导性名称。

In fact it prints the time spent inside safepoints. 实际上,它会打印在安全点内花费的时间。 Safepoint pauses occur not only due to Garbage Collection, but for many other reasons: 安全点暂停的发生不仅是由于垃圾收集,还有其他许多原因:

  • Deoptimization 反优化
  • Biased lock revocation 偏向锁吊销
  • Thread dump 线程转储
  • Heap inspection 堆检查
  • Class redifinition 类重定义
  • etc. (see the list) (请参见列表)

Safepoints may happen periodically even without a requested VM operation in order to deflate idle monitors, perform certain JIT cleanup and so on. 即使没有请求的VM操作,安全点也可能会定期发生,以便放空空闲的监视器,执行某些JIT清理等等。 See -XX:GuaranteedSafepointInterval VM option (1000 milliseconds by default). 请参阅-XX:GuaranteedSafepointInterval VM选项(默认为1000毫秒)。

Use -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 to dump more information about safepoints. 使用-XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1可以转储有关安全点的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM