Quantcast
Channel: Oracle Bloggers
Viewing all articles
Browse latest Browse all 19780

G1 GC Glossary of Terms

$
0
0

G1 GC Glossary of Terms

We will explain some terms displayed in g1 gc logs in this blog. This is an ongoing effort as the g1 gc logs keep evolving.  This is inspired by feedback by Charlie Hunt and others.

Heap Region:

G1 divides the heap into heap regions. The regions for Eden, Survivor and Old are not contiguous. Region size is 1m, 2m, 4m,8m, 16m, or 32m depending on heap size The goal is to have 2014 regions.

Collection Set(CSet):

The set of regions to be collected in a gc pause. The number of young/survivor/old regions in CSet is decided dynamically according to pause time goal and other heuristics.

Humongous Objects:

If the size of the object is larger than ½ of the region size, then g1 treats this object as Humongous Object.Regions used for humongous objects are HS(Humongous Start) and HC(Humongous Continuous). If HS is not big enough for this object, one or multiple HC regions will be used.

Young GC:

The collection set of the young gc includes only young/survivor regions.

Mixed GC:

The collection set of the mixed gc includes both young/survivor regions, but also old regions.

GC Cause:

The cause for this gc pause. Most common gc causes:

  • G1 Evacuation Pause: young or mixed gc is triggered when object allocation failed. “Evacuation” is the act of copying live objects from one G1 region to another available region.
  • System.gc(): gc is triggered by a system gc call.
  • GCLocker Initiated GC: gc is triggered when a JNI critical region was released. GC is blocked when any thread is in the JNI Critical region. If GC was requested during that period, that GC is invoked after all the threads come out of the JNI critical region.
  • Metadata GC Threshold: gc is triggered because the metadata space usage is over some threshold. We should not see this if ClassUnloadingWithConcurrentMark is enabled.
  • G1 Humongous Allocation: gc is triggered when allocating humongous object failed.
  • Heap Dump Initiated GC: full gc is triggered by heap dump request.
  • Allocation Failure: gc triggered to satisfy allocation failure.

Oop:

An object pointer. Specifically, a pointer into the GC-managed heap. (The term is traditional. One 'o' may stand for 'ordinary'). Oops may be directly manipulated by compiled or interpreted Java code, because the GC knows about the liveness and location of oops within such code.

Card Table:

Card and card table are data structures that record if the oop is changed. Each card represents 512-byte in the heap. The card table is an array with one byte entry per card. When updating a reference field of an object, the card containing the updated reference field is marked dirty by setting its entry in the card table to the appropriate value.

Remember Set(RSet):

The RSet is like a card table for each region. It records references from other regions to objects in this region. A regions’s Remember Set consists of card addresses. These cards contain locations of references that point into this region.

Update RS:

The cards in dirty card buffers need to be transformed to Remember Set. Part of the work is done by concurrent refinement threads in parallel with application threads. At the beginning of a stop the world gc pause, what is left by concurrent refinement threads is done by gc workers.

Scan RS:

Scan Remember Set is the process of walking through the remember set of the regions that are in CSet.

External Root Scan(Ext Root Scan):

Scan the gc roots that are outside the java heap. This includes globals, registers, code root from thread stacks, VM data structure, loaded classes, JNI handles, SystemDictionary.

Code Root Scan:

A region’s remember set contains the reference from the compiled code into this region. These references are added by compilation, not directly by the mutator. These code root(nmethod) are strong code root for that region.

Object Copy:

During Object Copy phase, the live objects are copied to the destination regions.

Termination:

When a gc worker thread finishes it’s work, it tries to steal work from other worker’s queue. If it can not steal work, it will terminate. The Termination time in gc log is the elapsed time between a worker thread finishes it’s work, and actually terminates. Long termination time indicates work not distributed evenly among the gc worker threads.

Code Root Fixup:

Time used to clean up the code root scope data structure.

Code Root Purge:

Time used to clean up the code root set table.

Clear CT:

Clears the card table of all regions that contains remember set entries. During Scan RS, if multiple regions are evacuated, it is possible that different remember sets contain the same card. Since scanning cards is expensive, we try to avoid scanning the same card by marking that card. The Clear CT step is to clear that mark so the card table can be used by mutator.

Redirty Cards:

Prepare card table for the next mutator phase. This phase marks the cards generated by evacuation dirty.

Free CSet:

Time used to put the cleaned regions back to free list.

Ref Proc:

Process soft/weak/final/phantom/JNI weak References.

SystemDictionary:

SystemDictionary is a hash table which contains loaded classes, which maps a class name/class loader pair to a klassOps. The SystemDictionary contains both class name/initiating loader pairs and class name/defining loader pairs.

nmethod:

nmethod(native method) is the compiled code version of Java methods.

To-space Exhausted:

When evacuating objects from Eden to Survivor or old gen, there is not enough space in the destination to hold the objects. When this happens, g1 need to restore the remembered set, recalculate statistics, re-set self forward pointers.

Reference:

  • Openjdk HotSpotGlossary (http://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html)
  • Internal document by Thomas.Schatlz and the G1 Dev Team.
  • Oracle Tech forum(https://community.oracle.com/thread/1543499?start=0&tstart=0).
  • Open jdk RuntimeOverview (http://openjdk.java.net/groups/hotspot/docs/RuntimeOverview.html)

Viewing all articles
Browse latest Browse all 19780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>