Analyzing gc logs
Asked Answered
R

1

4

I am using -XX:+PrintGCApplicationStoppedTime and -XX:+PrintGCApplicationConcurrentTime options to turn on gc logging.

But found that only after 4 0r 5 prints of PrintGCApplicationStoppedTime my actual details of gc logs printed through -XX:+PrintGCDetails command!

By definition PrintGCApplicationStoppedTime prints application stopped time for every 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

(or)

the log file will be logged by different gc threads. Im using Concurrent sweep for full GC and ParNew for the young generation

My application is web application.

O/p Pattern- Im getting like this:

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]
Reimers answered 16/4, 2015 at 5:30 Comment(0)
V
16

Unfortunately PrintGCApplicationStoppedTime is misleading name for this JVM option.

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. See -XX:GuaranteedSafepointInterval VM option (1000 milliseconds by default).

Use -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 to dump more information about safepoints.

Vancevancleave answered 16/4, 2015 at 11:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.