SlideShare a Scribd company logo
G1 Garbage Collector




Jaromir Hamala <jhamala@c2b2.co.uk>
           Senior Consultant
                 C2B2
         @c2b2consulting
Jaromir Hamala
 Who Am I?
 ■ A curious developer
 ■ Who likes to know more
    ■ About computers
    ■ World
    ■ And beer!




                            3
Agenda
 Memory Management
 Garbage Collectors in JVM
 CMS vs. G1
 G1 Tuning
 Recommendations
Manual Memory Management I
   Not all the memory is yours!
   You need to ask for it
         malloc() -> sbrk()

   And return when you no
    longer need it
          free() -> sbrk()




                                   5
Manual Memory Management II
   Asking for something is easy

   Returning is way more
    complicated!



          (we all know it!)




                                   6
Garbage Collector I
A little bit of history
     3000 B.C. – “The first landfill is
      developed when Knossos,
      Crete digs large holes for
      refuse. Garbage is dumped
      and filled with dirt at various
      levels.”
     In LISP from end of „50s!
     In Java from the 1st version



                                           8
Requirements on GC
  High Throughput
  Low Latency
  Minimal Footprint
  Reliable
  Easy to use/tune
Generational Hypothesis
  Most objects die young

  Old objects rarely reference young objects
Generational Garbage Collector
  Split the heap into regions
  Create new objects in Young
  Move mature objects to Old

  Different strategies for different regions
Characteristics of GCs
  Concurrent
  Parallel
  Compacting
Concurrent GC
Parallel GC
Heap Fragmentation
Heap Compacted
What we have in JVM? I
  Serial GC
  Parallel GC
What we have in JVM? II
  CMS
  G1
    since 6u14
    supported since 7u4
How CMS works in young generation II
How CMS works in young generation II
How CMS works in old generation
  Main phases of CMS:
    Initial Mark (STW)
    Concurrent Mark
    Remark (STW)
    Concurrent Sweep

  Features:
     Continuous block of memory
     No compacting!
Heap Fragmentation
What‟s the catch?
  Fragmentation
  Remark phase (STW)      “It’s working very well except
  Very Large Heaps              when it’s not”. –M. Brasier


 Promotion Failure
 Concurrent Mode Failure
Stop The World
G1
 Concurrent
 Parallel
 Compacting
G1 Goals
  Low Latency
  Better Predictability
  Easy to use & tune
G1 Heap Layout
  Heap divided into +- 2000 regions of equal
   size
  No physical separation between young /
   old generation
  Each region can be either young or old

  Object moved between regions during
   collections


  Humongous Region
    For large objects
    Expensive collecting as of now!
G1 Young Generation GC
G1 Old Generation GC I.
  Combination of CMS and Parallel Compacting GC
  Concurrent Marking Phase
  Remark still STW
     1929.299: [GC remark 1929.299: [GC ref-proc, 0.0048180 secs], 0.0258670 secs]
       [Times: user=0.03 sys=0.00, real=0.02 secs]
  Initial Marking part of evacuation pause
     62.583: [GC pause (young) (initial-mark), 0.09812400 secs]
    Calculating statistics data
      Ratio of living objects inside region
      Who references our region
G1 Old Generation GC II.
  Regions with no living
   objects can be
   reclaimed immediately
   (after remark)
G1 Old Generation GC III.
  Regions with smallest
   ratio of living objects
   chosen to evacuate
   during next GC
 53.695: [GC pause
 (mixed), 0.05568800 secs]
G1 Old Generation GC IV.
  Concurrent Marking Phase
    Calculate liveness ratio
    Find best regions to evacuate

  Reclaming Regions
    After Remark
    During evacuation pause
Remember Set
 Structure to track references from other
  regions
 One per region
 Allows to collects objects without tracking
  whole heap to find references
 Maintenance based on write barrier

            There is no free lunch!
Gotcha! (Part I.)
  More inter-region references -> Bigger
   Remember Set
  Large Remember Set -> Slow G1

  Remember: Large Object -> Humongous
   Region -> Collecting not optimized as yet
G1 Tuning Fundamentals
  Main goal of G1 is a low latency              -XX:+UseCMSInitiatingOccupancyOnly

  If you can tolerate latency use Parallel GC   -XX:CMSInitiatingOccupancyFraction=60

  Another goal is simplicity (of tuning)        -XX:CMSTriggerRatio=60
                                                 -XX:CMSWaitDuration=1500
                                                 -XX:ConcGCThreads=2
  Most important tuning option:                 -XX:SurvivorRatio=8
        -XX:MaxGCPauseMillis=300                 -Xmn1g
  Influence maximum amount of work per          ….
   collection
  No hard promise
  Best effort only
Other Import Tuning Options I
 -XX:InitiatingHeapOccupancyPercent=n
  When to start a concurrent GC cycle
  Percent of an entire heap, not just old
   geneneration!


    Too Low -> Unnecessary GC overhead
   Too High -> “Space Overflow” -> Full GC
Other Import Tuning Options II
 -XX:G1OldCSetRegionLiveThresholdPercent=n
  Threshold for region to be included in a
   Collection Set


  To High -> More aggressive collecting
     More live objects to copy
  To Low -> Wasting some heap
Other Import Tuning Options III
 -XX:G1MixedGCCountTarget=n
  How many Mixed GC / Concurrent Cycle

  To High -> Unnecessary overhead
  To Low -> Longer pauses
Considerations Before Tuning
  Some options cause your
   PauseTimeTarget to be ignored!
                    -Xmn
  Fixed young generation size
Logging the GC Activity
  Verbose GC is your friend!
 -XX:+PrintGC -XX:+PrintGCDetails -
 XX:+PrintGCTimeStamps
  Always use it! Even in production.
  Very low overhead. There is no excuse!

  Will help you analyze help your GC is
   performing
G1 GC Log
1.297: [GC pause (young), 0.02828800 secs]
  [Parallel Time:   24.2 ms]
      [GC Worker Start (ms):    1296.7    1302.7
       Avg: 1299.7, Min: 1296.7, Max: 1302.7, Diff:       6.0]
      [Ext Root Scanning (ms):    16.5    2.9
       Avg:   9.7, Min:    2.9, Max:     16.5, Diff:   13.6]
      [Update RS (ms):    0.0   0.0
       Avg:   0.0, Min:    0.0, Max:     0.0, Diff:    0.0]
        [Processed Buffers : 0 9
          Sum: 9, Avg: 4, Min: 0, Max: 9, Diff: 9]
[…]
G1 GC Log
1.297: [GC pause (young), 0.02828800 secs]
   Young GC
   Started 1.297s from the start of JVM
   Total elapsed time was 0.02828800s
[Parallel Time:    24.2 ms]
   Total   elapsed time spent by parallel GC thread
G1 GC Log
[GC Worker Start (ms):      1296.7        1302.7
        Avg: 1299.7, Min: 1296.7, Max: 1302.7, Diff:              6.0]
 Two threads and starting times

 [Ext Root Scanning (ms):          16.5   2.9
        Avg:    9.7, Min:      2.9, Max:        16.5, Diff:   13.6]
 Time spent by each thread by scanning the roots
G1 GC Log
[Update RS (ms):      0.0    0.0
        Avg:     0.0, Min:        0.0, Max:    0.0, Diff:        0.0]
           [Processed Buffers : 0 9
            Sum: 9, Avg: 4, Min: 0, Max: 9, Diff: 9]
 Time spent by updating Remember Sets regions
 Update Buffers is a structure tracking changes in references

[Scan RS (ms):     0.0      0.1
        Avg:     0.0, Min:         0.0, Max:   0.1, Diff:        0.1].
 Time spent by scanning areas from Remember Set
G1 GC Log
[Object Copy (ms):      7.6   15.1
        Avg:   11.3, Min:      7.6, Max:      15.1, Diff:   7.5]
 Time spent by copying objects to other regions
 Usually significant portion of a total time

[Termination (ms):      0.0   0.0
        Avg:     0.0, Min:     0.0, Max:       0.0, Diff:   0.0]
          [Termination Attempts : 1 1
            Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0]
 Time spent by offering to terminate
 Threads are stealing work from the others
G1 Logging Options I
  -XX:+PrintAdaptiveSizePolicy
 53.628: [GC pause (mixed) 53.628: [G1Ergonomics (CSet Construction) start choosing CSet, predicted
 base time: 54.79 ms, remaining time: 145.21 ms, target pause time: 200.00 ms]
  53.628: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 51 regions, survivors:
 2 regions, predicted young region time: 9.75 ms]
  53.628: [G1Ergonomics (CSet Construction) finish adding old regions to CSet, reason: old CSet
 region num reached max, old: 27 regions, max: 27 regions]
  53.628: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 51 regions, survivors: 2
 regions, old: 27 regions, predicted pause time: 131.56 ms, target pause time: 200.00 ms]
  53.700: [G1Ergonomics (Concurrent Cycles) do not request concurrent cycle initiation, reason:
 still doing mixed collections, occupancy: 127926272 bytes, allocation request: 0 bytes, threshold:
 125986365 bytes (45.00 %), source: end of GC]
G1 Evacuation Failure
  Evacuation Failure Happens when we do not have empty regions
  Heap is already at maximum size
  Very expensive operation!
  Search for “to-space overflow”

  Remedy:
    Increase to heap size
    -XX:InitiatingHeapOccupancyPercent=
    More marking threads
Is G1 Production Ready?
  It depends!
     Well, some people use it in production
  The days of G1 crashing JVM are hopefully over
  Still quite significant changes
  Bugs are still being found
     Bug 7181612 : G1: Premature Evacuation (7143858) strikes again
     Bug 7143858 : G1: Back to back young GCs with the second GC having a minimally
     sized eden


  You should probably evaluate/use G1 when everything else is failing
  And you have no alternative!
GC Decisioning: Rules of Thumb I
  Do I really need a Low Latency
    No? Use Parallel GC
  Do I really need a Big Heap?
    Yes? Think again!

  Do I really need a Big Heap?
    No? Use small heap & Parallel GC
    Yes? Try CMS 1st
GC Decisioning: Rules of Thumb II
  Is CMS performing well?
     Yes? Done!
     No? Tune it!
  Is tuned CMS performing well?
     Yes? Done!
     No? Tune it more!
  Is CMS performing well now?
     Yes? Done!
     No? Do you really need such big heap?
GC Decisioning: Rules of Thumb III
  Yes, I really need a Big Heap a Low Pauses!
    This is the moment where you should start considering to use G1!

  In Nutshell:
     For now treat G1 as a last resort
     When other GCs are failing
     Be aware of gotchas:
       Very Large Objects
       Large Remember Sets
       Footprint?
     Test carefully before using in a production!
G1 – Recent Commits
 date:      Tue Oct 30 11:45:51 2012 -0700
 summary:     7200261: G1: Liveness counting inconsistencies during marking verification


 date:      Thu Sep 20 09:52:56 2012 -0700
 summary:     7190666: G1: assert(_unused == 0) failed: Inconsistency in PLAB stats


 date:      Tue Aug 21 14:10:39 2012 -0700
 summary:     7185699: G1: Prediction model discrepancies
G1 – Recent Commits – Conclusion?
  Do not use anything before 7u4
    Use 7u9 or later
    The latest version in the best case

  Do not use G1 from Java 6
What Are The Alternatives?
  Workaround / Hacks:

  Off Heap Allocations
    DirectBuffers
    JNI

  Object Pooling
Further Resources
  JavaOne 2012 G1 Talk, Charlie Hunt, Monica Beckwith
  hotstop-gc-use mailinglist
  http://www.quora.com/What-is-the-status-of-the-implementation-of-the-G1-garbage-
   collector-for-the-JVM#
  ….
Q&A

More Related Content

What's hot

GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
Monica Beckwith
 
G1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningG1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and Tuning
Simone Bordet
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
Scott Seighman
 
Low pause GC in HotSpot
Low pause GC in HotSpotLow pause GC in HotSpot
Low pause GC in HotSpot
jClarity
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
Monica Beckwith
 
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual MachineThe Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
Monica Beckwith
 
Storing Cassandra Metrics
Storing Cassandra MetricsStoring Cassandra Metrics
Storing Cassandra Metrics
Chris Lohfink
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
Monica Beckwith
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
Vladislav Gangan
 
Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GC
Monica Beckwith
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Monica Beckwith
 
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Monica Beckwith
 
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationLudovic Poitou
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection TuningKai Koenig
 
GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)
Monica Beckwith
 
Moving to G1GC
Moving to G1GCMoving to G1GC
Moving to G1GC
Kirk Pepperdine
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issues
Sergey Podolsky
 
Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)
Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)
Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)
Red Hat Developers
 
JVM memory management & Diagnostics
JVM memory management & DiagnosticsJVM memory management & Diagnostics
JVM memory management & Diagnostics
Dhaval Shah
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
Prem Kuppumani
 

What's hot (20)

GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
 
G1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningG1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and Tuning
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
 
Low pause GC in HotSpot
Low pause GC in HotSpotLow pause GC in HotSpot
Low pause GC in HotSpot
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
 
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual MachineThe Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
 
Storing Cassandra Metrics
Storing Cassandra MetricsStoring Cassandra Metrics
Storing Cassandra Metrics
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GC
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!
 
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
 
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)
 
Moving to G1GC
Moving to G1GCMoving to G1GC
Moving to G1GC
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issues
 
Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)
Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)
Shenandoah GC: Java Without The Garbage Collection Hiccups (Christine Flood)
 
JVM memory management & Diagnostics
JVM memory management & DiagnosticsJVM memory management & Diagnostics
JVM memory management & Diagnostics
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 

Viewers also liked

Programming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and GrizzlyProgramming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and Grizzly
C2B2 Consulting
 
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBaseHBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon
 
Software Developers Guide to Fun in the Workplace: Euphoria Despite the Despair
Software Developers Guide to Fun in the Workplace: Euphoria Despite the DespairSoftware Developers Guide to Fun in the Workplace: Euphoria Despite the Despair
Software Developers Guide to Fun in the Workplace: Euphoria Despite the Despair
Holly Cummins
 
Java7 Garbage Collector G1
Java7 Garbage Collector G1Java7 Garbage Collector G1
Java7 Garbage Collector G1Dmitry Buzdin
 
How to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning BattleHow to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning Battle
Capgemini
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
achinth
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
Mudit Gupta
 
Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)
Ashish Jha
 
Garbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerGarbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika Langer
JAXLondon_Conference
 
Heap Management
Heap ManagementHeap Management
Heap Management
Jenny Galino
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
Somya Bagai
 
Garbage collection algorithms
Garbage collection algorithmsGarbage collection algorithms
Garbage collection algorithms
achinth
 
How long can you afford to Stop The World?
How long can you afford to Stop The World?How long can you afford to Stop The World?
How long can you afford to Stop The World?
Java Usergroup Berlin-Brandenburg
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
Azul Systems Inc.
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
Haim Yadid
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection TechniquesAn Khuong
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage Collection
Doug Hawkins
 

Viewers also liked (19)

Programming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and GrizzlyProgramming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and Grizzly
 
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBaseHBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
 
Software Developers Guide to Fun in the Workplace: Euphoria Despite the Despair
Software Developers Guide to Fun in the Workplace: Euphoria Despite the DespairSoftware Developers Guide to Fun in the Workplace: Euphoria Despite the Despair
Software Developers Guide to Fun in the Workplace: Euphoria Despite the Despair
 
Java7 Garbage Collector G1
Java7 Garbage Collector G1Java7 Garbage Collector G1
Java7 Garbage Collector G1
 
How to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning BattleHow to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning Battle
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)
 
Garbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerGarbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika Langer
 
Heap Management
Heap ManagementHeap Management
Heap Management
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Garbage collection algorithms
Garbage collection algorithmsGarbage collection algorithms
Garbage collection algorithms
 
How long can you afford to Stop The World?
How long can you afford to Stop The World?How long can you afford to Stop The World?
How long can you afford to Stop The World?
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
 
Java GC
Java GCJava GC
Java GC
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection Techniques
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage Collection
 

Similar to G1 Garbage Collector - Big Heaps and Low Pauses?

Am I reading GC logs Correctly?
Am I reading GC logs Correctly?Am I reading GC logs Correctly?
Am I reading GC logs Correctly?
Tier1 App
 
Taming Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage Collector
Daya Atapattu
 
Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
Tier1app
 
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
ColdFusionConference
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and you
Kai Koenig
 
Garbage First and You!
Garbage First and You!Garbage First and You!
Garbage First and You!
devObjective
 
Pick diamonds from garbage
Pick diamonds from garbagePick diamonds from garbage
Pick diamonds from garbage
Tier1 App
 
JVM Magic
JVM MagicJVM Magic
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GCHadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Erik Krogen
 
Jvm & Garbage collection tuning for low latencies application
Jvm & Garbage collection tuning for low latencies applicationJvm & Garbage collection tuning for low latencies application
Jvm & Garbage collection tuning for low latencies application
Quentin Ambard
 
Become a GC Hero
Become a GC HeroBecome a GC Hero
Become a GC Hero
Tier1app
 
Tp cms-g1-v4
Tp cms-g1-v4Tp cms-g1-v4
Tp cms-g1-v4
Tobias Frech
 
Gc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linuxGc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linuxCuong Tran
 
Become a Java GC Hero - ConFoo Conference
Become a Java GC Hero - ConFoo ConferenceBecome a Java GC Hero - ConFoo Conference
Become a Java GC Hero - ConFoo Conference
Tier1app
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
SAP HANA Cloud Platform
 
Jvm tuning for low latency application & Cassandra
Jvm tuning for low latency application & CassandraJvm tuning for low latency application & Cassandra
Jvm tuning for low latency application & Cassandra
Quentin Ambard
 
Exploring Garbage Collection
Exploring Garbage CollectionExploring Garbage Collection
Exploring Garbage Collection
ESUG
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptx
Tier1 app
 
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
Haim Yadid
 

Similar to G1 Garbage Collector - Big Heaps and Low Pauses? (20)

Hotspot gc
Hotspot gcHotspot gc
Hotspot gc
 
Am I reading GC logs Correctly?
Am I reading GC logs Correctly?Am I reading GC logs Correctly?
Am I reading GC logs Correctly?
 
Taming Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage Collector
 
Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
 
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and you
 
Garbage First and You!
Garbage First and You!Garbage First and You!
Garbage First and You!
 
Pick diamonds from garbage
Pick diamonds from garbagePick diamonds from garbage
Pick diamonds from garbage
 
JVM Magic
JVM MagicJVM Magic
JVM Magic
 
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GCHadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
 
Jvm & Garbage collection tuning for low latencies application
Jvm & Garbage collection tuning for low latencies applicationJvm & Garbage collection tuning for low latencies application
Jvm & Garbage collection tuning for low latencies application
 
Become a GC Hero
Become a GC HeroBecome a GC Hero
Become a GC Hero
 
Tp cms-g1-v4
Tp cms-g1-v4Tp cms-g1-v4
Tp cms-g1-v4
 
Gc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linuxGc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linux
 
Become a Java GC Hero - ConFoo Conference
Become a Java GC Hero - ConFoo ConferenceBecome a Java GC Hero - ConFoo Conference
Become a Java GC Hero - ConFoo Conference
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
Jvm tuning for low latency application & Cassandra
Jvm tuning for low latency application & CassandraJvm tuning for low latency application & Cassandra
Jvm tuning for low latency application & Cassandra
 
Exploring Garbage Collection
Exploring Garbage CollectionExploring Garbage Collection
Exploring Garbage Collection
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptx
 
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
 

More from C2B2 Consulting

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
C2B2 Consulting
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
C2B2 Consulting
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA Suite
C2B2 Consulting
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
C2B2 Consulting
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
C2B2 Consulting
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
C2B2 Consulting
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performance
C2B2 Consulting
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!
C2B2 Consulting
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShift
C2B2 Consulting
 
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
C2B2 Consulting
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
C2B2 Consulting
 
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleOracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
C2B2 Consulting
 
Java Middleware Surgery
Java Middleware Surgery Java Middleware Surgery
Java Middleware Surgery
C2B2 Consulting
 
Jax London 2013
Jax London 2013Jax London 2013
Jax London 2013
C2B2 Consulting
 
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
C2B2 Consulting
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker'
C2B2 Consulting
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
C2B2 Consulting
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
C2B2 Consulting
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
C2B2 Consulting
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
C2B2 Consulting
 

More from C2B2 Consulting (20)

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA Suite
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performance
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShift
 
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
 
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleOracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
 
Java Middleware Surgery
Java Middleware Surgery Java Middleware Surgery
Java Middleware Surgery
 
Jax London 2013
Jax London 2013Jax London 2013
Jax London 2013
 
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker'
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
 

Recently uploaded

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

G1 Garbage Collector - Big Heaps and Low Pauses?

  • 1.
  • 2. G1 Garbage Collector Jaromir Hamala <jhamala@c2b2.co.uk> Senior Consultant C2B2 @c2b2consulting
  • 3. Jaromir Hamala Who Am I? ■ A curious developer ■ Who likes to know more ■ About computers ■ World ■ And beer! 3
  • 4. Agenda  Memory Management  Garbage Collectors in JVM  CMS vs. G1  G1 Tuning  Recommendations
  • 5. Manual Memory Management I  Not all the memory is yours!  You need to ask for it malloc() -> sbrk()  And return when you no longer need it free() -> sbrk() 5
  • 6. Manual Memory Management II  Asking for something is easy  Returning is way more complicated! (we all know it!) 6
  • 8. A little bit of history  3000 B.C. – “The first landfill is developed when Knossos, Crete digs large holes for refuse. Garbage is dumped and filled with dirt at various levels.”  In LISP from end of „50s!  In Java from the 1st version 8
  • 9. Requirements on GC  High Throughput  Low Latency  Minimal Footprint  Reliable  Easy to use/tune
  • 10. Generational Hypothesis  Most objects die young  Old objects rarely reference young objects
  • 11. Generational Garbage Collector  Split the heap into regions  Create new objects in Young  Move mature objects to Old  Different strategies for different regions
  • 12. Characteristics of GCs  Concurrent  Parallel  Compacting
  • 17. What we have in JVM? I  Serial GC  Parallel GC
  • 18. What we have in JVM? II  CMS  G1  since 6u14  supported since 7u4
  • 19. How CMS works in young generation II
  • 20. How CMS works in young generation II
  • 21. How CMS works in old generation  Main phases of CMS:  Initial Mark (STW)  Concurrent Mark  Remark (STW)  Concurrent Sweep  Features:  Continuous block of memory  No compacting!
  • 23. What‟s the catch?  Fragmentation  Remark phase (STW) “It’s working very well except  Very Large Heaps when it’s not”. –M. Brasier Promotion Failure Concurrent Mode Failure
  • 26. G1 Goals  Low Latency  Better Predictability  Easy to use & tune
  • 27. G1 Heap Layout  Heap divided into +- 2000 regions of equal size  No physical separation between young / old generation  Each region can be either young or old  Object moved between regions during collections  Humongous Region  For large objects  Expensive collecting as of now!
  • 29. G1 Old Generation GC I.  Combination of CMS and Parallel Compacting GC  Concurrent Marking Phase  Remark still STW 1929.299: [GC remark 1929.299: [GC ref-proc, 0.0048180 secs], 0.0258670 secs] [Times: user=0.03 sys=0.00, real=0.02 secs]  Initial Marking part of evacuation pause 62.583: [GC pause (young) (initial-mark), 0.09812400 secs]  Calculating statistics data  Ratio of living objects inside region  Who references our region
  • 30. G1 Old Generation GC II.  Regions with no living objects can be reclaimed immediately (after remark)
  • 31. G1 Old Generation GC III.  Regions with smallest ratio of living objects chosen to evacuate during next GC 53.695: [GC pause (mixed), 0.05568800 secs]
  • 32. G1 Old Generation GC IV.  Concurrent Marking Phase  Calculate liveness ratio  Find best regions to evacuate  Reclaming Regions  After Remark  During evacuation pause
  • 33. Remember Set  Structure to track references from other regions  One per region  Allows to collects objects without tracking whole heap to find references  Maintenance based on write barrier There is no free lunch!
  • 34. Gotcha! (Part I.)  More inter-region references -> Bigger Remember Set  Large Remember Set -> Slow G1  Remember: Large Object -> Humongous Region -> Collecting not optimized as yet
  • 35. G1 Tuning Fundamentals  Main goal of G1 is a low latency -XX:+UseCMSInitiatingOccupancyOnly  If you can tolerate latency use Parallel GC -XX:CMSInitiatingOccupancyFraction=60  Another goal is simplicity (of tuning) -XX:CMSTriggerRatio=60 -XX:CMSWaitDuration=1500 -XX:ConcGCThreads=2  Most important tuning option: -XX:SurvivorRatio=8 -XX:MaxGCPauseMillis=300 -Xmn1g  Influence maximum amount of work per …. collection  No hard promise  Best effort only
  • 36. Other Import Tuning Options I -XX:InitiatingHeapOccupancyPercent=n  When to start a concurrent GC cycle  Percent of an entire heap, not just old geneneration! Too Low -> Unnecessary GC overhead Too High -> “Space Overflow” -> Full GC
  • 37. Other Import Tuning Options II -XX:G1OldCSetRegionLiveThresholdPercent=n  Threshold for region to be included in a Collection Set  To High -> More aggressive collecting  More live objects to copy  To Low -> Wasting some heap
  • 38. Other Import Tuning Options III -XX:G1MixedGCCountTarget=n  How many Mixed GC / Concurrent Cycle  To High -> Unnecessary overhead  To Low -> Longer pauses
  • 39. Considerations Before Tuning  Some options cause your PauseTimeTarget to be ignored! -Xmn  Fixed young generation size
  • 40. Logging the GC Activity  Verbose GC is your friend! -XX:+PrintGC -XX:+PrintGCDetails - XX:+PrintGCTimeStamps  Always use it! Even in production.  Very low overhead. There is no excuse!  Will help you analyze help your GC is performing
  • 41. G1 GC Log 1.297: [GC pause (young), 0.02828800 secs] [Parallel Time: 24.2 ms] [GC Worker Start (ms): 1296.7 1302.7 Avg: 1299.7, Min: 1296.7, Max: 1302.7, Diff: 6.0] [Ext Root Scanning (ms): 16.5 2.9 Avg: 9.7, Min: 2.9, Max: 16.5, Diff: 13.6] [Update RS (ms): 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0] [Processed Buffers : 0 9 Sum: 9, Avg: 4, Min: 0, Max: 9, Diff: 9] […]
  • 42. G1 GC Log 1.297: [GC pause (young), 0.02828800 secs]  Young GC  Started 1.297s from the start of JVM  Total elapsed time was 0.02828800s [Parallel Time: 24.2 ms]  Total elapsed time spent by parallel GC thread
  • 43. G1 GC Log [GC Worker Start (ms): 1296.7 1302.7 Avg: 1299.7, Min: 1296.7, Max: 1302.7, Diff: 6.0]  Two threads and starting times [Ext Root Scanning (ms): 16.5 2.9 Avg: 9.7, Min: 2.9, Max: 16.5, Diff: 13.6]  Time spent by each thread by scanning the roots
  • 44. G1 GC Log [Update RS (ms): 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0] [Processed Buffers : 0 9 Sum: 9, Avg: 4, Min: 0, Max: 9, Diff: 9]  Time spent by updating Remember Sets regions  Update Buffers is a structure tracking changes in references [Scan RS (ms): 0.0 0.1 Avg: 0.0, Min: 0.0, Max: 0.1, Diff: 0.1].  Time spent by scanning areas from Remember Set
  • 45. G1 GC Log [Object Copy (ms): 7.6 15.1 Avg: 11.3, Min: 7.6, Max: 15.1, Diff: 7.5]  Time spent by copying objects to other regions  Usually significant portion of a total time [Termination (ms): 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0] [Termination Attempts : 1 1 Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0]  Time spent by offering to terminate  Threads are stealing work from the others
  • 46. G1 Logging Options I  -XX:+PrintAdaptiveSizePolicy 53.628: [GC pause (mixed) 53.628: [G1Ergonomics (CSet Construction) start choosing CSet, predicted base time: 54.79 ms, remaining time: 145.21 ms, target pause time: 200.00 ms] 53.628: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 51 regions, survivors: 2 regions, predicted young region time: 9.75 ms] 53.628: [G1Ergonomics (CSet Construction) finish adding old regions to CSet, reason: old CSet region num reached max, old: 27 regions, max: 27 regions] 53.628: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 51 regions, survivors: 2 regions, old: 27 regions, predicted pause time: 131.56 ms, target pause time: 200.00 ms] 53.700: [G1Ergonomics (Concurrent Cycles) do not request concurrent cycle initiation, reason: still doing mixed collections, occupancy: 127926272 bytes, allocation request: 0 bytes, threshold: 125986365 bytes (45.00 %), source: end of GC]
  • 47. G1 Evacuation Failure  Evacuation Failure Happens when we do not have empty regions  Heap is already at maximum size  Very expensive operation!  Search for “to-space overflow”  Remedy:  Increase to heap size  -XX:InitiatingHeapOccupancyPercent=  More marking threads
  • 48. Is G1 Production Ready?  It depends!  Well, some people use it in production  The days of G1 crashing JVM are hopefully over  Still quite significant changes  Bugs are still being found  Bug 7181612 : G1: Premature Evacuation (7143858) strikes again  Bug 7143858 : G1: Back to back young GCs with the second GC having a minimally sized eden  You should probably evaluate/use G1 when everything else is failing  And you have no alternative!
  • 49. GC Decisioning: Rules of Thumb I  Do I really need a Low Latency  No? Use Parallel GC  Do I really need a Big Heap?  Yes? Think again!  Do I really need a Big Heap?  No? Use small heap & Parallel GC  Yes? Try CMS 1st
  • 50. GC Decisioning: Rules of Thumb II  Is CMS performing well?  Yes? Done!  No? Tune it!  Is tuned CMS performing well?  Yes? Done!  No? Tune it more!  Is CMS performing well now?  Yes? Done!  No? Do you really need such big heap?
  • 51. GC Decisioning: Rules of Thumb III  Yes, I really need a Big Heap a Low Pauses!  This is the moment where you should start considering to use G1!  In Nutshell:  For now treat G1 as a last resort  When other GCs are failing  Be aware of gotchas: Very Large Objects Large Remember Sets Footprint?  Test carefully before using in a production!
  • 52. G1 – Recent Commits date: Tue Oct 30 11:45:51 2012 -0700 summary: 7200261: G1: Liveness counting inconsistencies during marking verification date: Thu Sep 20 09:52:56 2012 -0700 summary: 7190666: G1: assert(_unused == 0) failed: Inconsistency in PLAB stats date: Tue Aug 21 14:10:39 2012 -0700 summary: 7185699: G1: Prediction model discrepancies
  • 53. G1 – Recent Commits – Conclusion?  Do not use anything before 7u4  Use 7u9 or later  The latest version in the best case  Do not use G1 from Java 6
  • 54. What Are The Alternatives?  Workaround / Hacks:  Off Heap Allocations  DirectBuffers  JNI  Object Pooling
  • 55. Further Resources  JavaOne 2012 G1 Talk, Charlie Hunt, Monica Beckwith  hotstop-gc-use mailinglist  http://www.quora.com/What-is-the-status-of-the-implementation-of-the-G1-garbage- collector-for-the-JVM#  ….
  • 56. Q&A

Editor's Notes

  1. not only in JVM. for example .NET or Python
  2. difference between conccurent vs. parallel
  3. ability to run at the same time as my application
  4. parallelism = more threads to do the GC work
  5. compactation = ability to create consolidate blocks of free space
  6. first setdifferent implementations for young and old generations, but same in principles
  7. -initial mark = finding root objects – references from thread stack + references from young space-no compactation
  8. too good to be true!
  9. -size of region between 1MB – 32MB, always power of 2-what is large object? over 50% of size of the region
  10. -stop the world-parallel-calculation of new young gen size
  11. -statistics are used to estimate an effort to evacuate the region-remark use different algorithm
  12. -no separate old GC – together with young gc-only a subset of regions
  13. different algorithm for marking – snapshot at the beginning
  14. -Tuning is Easy - in contrast of CMS-
  15. XX:InitiatingHeapOccupancyPercent=45
  16. XX:G1OldCSetRegionLiveThresholdPercent=90
  17. XX:G1MixedGCCountTarget=4
  18. -is GC bottleneck?-what phases of GC?-what to tune?
  19. solve only some problems-bigmemory / coherence-tomcat
  20. solve only some problems-bigmemory / coherence-tomcat