Pydi
Pydi

Reputation: 77

how to find application suspension time from GC log files

I am new to Garbage collection ,Plz some one help me to get answers for my following questions with clear explanation

I want to find application suspension time and suspension count from the GC logs files for different JVM's :

of different versions.

A. For SUN i am using JVM options

-Xloggc:gc.log -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+UseParNewGC -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode

B. For JRockit i am using JVM options

-Xms100m -Xmx100m -Xns50m -Xss200k -Xgc:genconpar -Xverbose:gc -Xverboselog:gc_jrockit.log

My Questions are

Q1. What is suspension time of an application and why it occurs.

Q2. How to say by looking on logs that suspension was occurred.

Q3. Does suspension time of an application = sum of GC Times.

Eg:

2013-09-06T23:35:23.382-0700: [GC 150.505: [ParNew Desired survivor size 50331648 bytes, new threshold 2 (max 15) - age 1: 28731664 bytes, 28731664 total - age 2: 28248376 bytes, 56980040 total : 688128K->98304K(688128K), 0.2166700 secs] 697655K->163736K(10387456K), 0.2167900 secs] [Times: user=0.44 sys=0.04, real=0.22 secs]

2013-09-06T23:35:28.044-0700: 155.167: [GC 155.167: [ParNew Desired survivor size 50331648 bytes, new threshold 15 (max 15) - age 1: 22333512 bytes, 22333512 total - age 2: 27468336 bytes, 49801848 total : 688128K->71707K(688128K), 0.0737140 secs] 753560K->164731K(10387456K), 0.0738410 secs] [Times: user=0.30 sys=0.02, real=0.07 secs]

suspensionTime = 0.2167900 secs + 0.0738410 secs

i. If yes do i need to add all times for every gc occurs

ii. If no Plz explain me in detail for those logs we consider that suspension occured and those not consider for different Collectors with logs

Q4. Can we say GC times "0.2167900 , 0.0738410" are equal to GC Pauses ie;TotalGCPause = 0.2167900 + 0.0738410

Q5. Can we calculate suspension time by using only above flags or we need to include extra flags like -XX:+PrintGCApplicationStoppedTime for SUN

Q6. I seen an tool dyna trace it calculating suspension time and count for SUN with out using the flag -XX:+PrintGCApplicationStoppedTime

Upvotes: 4

Views: 2527

Answers (1)

Aleš
Aleš

Reputation: 9028

If you want the most precise information about the amount of time your application was stopped due to GC activity, you should go with -XX:+PrintGCApplicationStoppedTime.

-XX:+PrintGCApplicationStoppedTime enables the printing of the amount of time application threads have been stopped as the result of an internal HotSpot VM operation (GC and safe-point operations).

But, for practical daily usage the information provided by the GC logs is sufficient. You can use the approach described in your question 3. to determine the time spent in the GC.

Upvotes: 1

Related Questions