Young garbage collector longer pause with java 7 vs java 6

I noticed that every young garbage collection with java 7 takes on average 10 more milliseconds than with java 6. I use 1.6.0_31 and 1.7.0_21 . The configuration has not changed; there are also no JVM hardware arguments:

 -server -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+TieredCompilation -XX:+AggressiveOpts -Xms1g -Xmx1g -XX:MaxNewSize=256m -XX:NewSize=256m 
  • Java 7:
  S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT   
 26176.0 26176.0 3531.6 0.0 209792.0 21648.8 786432.0 86777.6 49472.0 49350.1 82 1.830 0 0.000 1.
  • Java 6
  S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT   
 26176.0 26176.0 0.0 1210.5 209792.0 95873.4 786432.0 65327.1 35968.0 35891.2 83 0.620 0 0.000 0.620

I also looked at each individual time, and using java 6 each YGC takes ~ 10 ms versus java 7 is 20 ms. Has something changed between versions 6 and 7 that could explain this behavior?

EDIT: I noticed that java 7 runs in 64-bit mode, while java 6 uses a 32-bit JVM, can this explain the difference?

thanks

+7
java garbage-collection java-7 java-6
source share
1 answer

By default, -XX:NewRatio is 8 for Java 6, but 2 for Java 7. therefore in java 6 the size of the younger generation is smaller than java 7, hence the difference i feel.

Because the time to collect garbage from the city is directly proportional to how big the city is. if the size of the city increases, then time.

+2
source share

All Articles