G1 feedback: frantic GC cycles

Simone Bordet simone.bordet at gmail.com
Fri Apr 29 17:59:12 UTC 2011


Hi,

I am running with JDK 7:

java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b139)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b09, mixed mode)

The application is IntelliJ IDEA, and I am using these command lines options:

-Xms1024m
-Xmx1024m
-Xmn512m
-XX:MaxPermSize=256m
-ea
-verbose:gc
-XX:+PrintGCDetails
-XX:+DisableExplicitGC
-XX:+PrintGCDateStamps
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+TieredCompilation
-XX:+PrintCommandLineFlags
-XX:+AggressiveOpts

The application works well, I use it heavily for coding, and G1 works
well: small pauses (which is what I like when I have keyboard-based
mind-less automatisms) and stable.

However, from time to time, say 2-3 times a day, I experience a few
seconds of frantic GC cycles from G1, for which I have attached a log.
The log starts at 18:44:10 (previous logging was fine and I hope not
relevant), and the frantic cycles start at 19:14:08 (around line 4741
of the log) and lasts roughly 20 seconds.
During these 20 seconds, the application was unresponsive (that is
what allowed me to detect these frantic GC cycles) so I stopped
working on it to look at the GC logs and waited until the GC came back
to normal activity (i.e. the frantic cycles stopped).

After those 20 seconds, G1 seems to be able to go back to normal
activity and the application works again well.
During those 20 seconds, there has been roughly one collection every
100 ms or so.

It is entirely possible that the application is leaking (I'm just a
user, not a developer of the application).
I was wondering if someone saw this before ?

>From the logs and jconsole, it seems that the old generation is quite
full (jconsole reported 540 M occupied) , but I still have ~512 M
available of young generation available (and jconsole confirms that a
young GC brings the new generation to 6 M or less).

Other than using G1 for the IDE, I often consult on GC tuning, so any
additional information or improvement to G1 is good news for me, and
understanding this behavior will help on suggesting G1 to customers or
tuning G1 better.

I am pretty sure I saw the same anomaly (frantic cycles) with G1 on
JDK 6 as well (1.6.0_24), so it seems more a G1 behavior than JDK's.

I can fairly easily reproduce the problem on a daily basis, so any
suggestion to track down this issue is welcome (like additional
command line switches, or confirmation that it happens with JDK 6 as
well, etc.)

Thanks !

Simon
-- 
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g1_spin.log.gz
Type: application/x-gzip
Size: 52987 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20110429/d2e8fb4c/g1_spin.log.gz>


More information about the hotspot-gc-dev mailing list