-XX:+USEG1GC
Since JDK 9 G1 will be default GC algorithm. Meanwhile, the level of its usage or just knowledge of the principles is much lower when compared to the number of myths and urban legends. We should know, that G1 introduces revolutionizing approach to memory management in the JVM by changing both the current structure of the heap and way of running major and minor collections. But unfortunately there are still some "childhood diseases" we should be aware of.
During the presentation, I will describe the algorithm, its characteristics and the real possibility of usage on a daily basis. We'll also discus some tricks allowing for stress-free deployment and optimization.
2. @jkubrynskijk@devskiller.com
Who are we?
- Me
- $ since 2004
- Co-Founder of DevSKiller.com + Codearte.io
- JVM passionate
- Trainer @ Bottega
- You
- Java developers?
- GC logs analysts?
- JVM tuners?
3. @jkubrynskijk@devskiller.com
Why all this mess?
Because applications need memory...
… and memory is limited
Developers are too lazy to manage memory
manually...
… and Garbage Collector has a limited
performance and a need to stop the world
21. @jkubrynskijk@devskiller.com
Mixed GC
Regions marked in the previous step are
cleaned during mixed collections
Young generation + part of old
Processes
- min => marked regions count / G1MixedGCCountTarget
- max => 10% of all regions
31. @jkubrynskijk@devskiller.com
Will stay default in JDK 9?
Kirk Pepperdine: Using G1 is known to corrupt Lucene indexes
Charlie Hunt: Does the term "known" imply past tense? ;-)
You know I'm just having a little fun with you, right?
Kirk Pepperdine: Dude, seriously..
Stefan Johansson: A short heads up. The change to make G1
the default garbage collector has now made its way to
jdk9/dev and should soon be part of a JDK 9 early access
build.