G1: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 8: Line 8:
=Internal=
=Internal=


* [[Java Garbage Collection#Gargage_Collectors|Gargage Collection]]
* [[Java Memory#Gargage_Collectors|Garbage Collection]]


=Overview=
=Overview=
Line 56: Line 56:
===Metaspace Threshold Reached===
===Metaspace Threshold Reached===


==System.gc()==
A  [[#Collection|collection]]  is triggered when metadata space usage reaches a threshold. This should not bee seen if ClassUnloadingWithConcurrentMark is enabled. These collections are reported in the GC logs as "Metadata GC Threshold":


The collection is triggered by a <tt>System.gc()</tt> call.
<pre>
2017-02-14T03:40:58.787-0600: 36.237: [GC pause (Metadata GC Threshold) (young) (initial-mark), 0.3979489 secs]
    ...
</pre>
 
===GCLocker Initiated GC===
 
A  [[#Collection|collection]]  is triggered when a JNI critical region was released. Garbage collection is blocked when any thread is in the JNI Critical region. If garbage collection was requested during that period, that garbage collection is invoked after all the threads come out of the JNI critical region.These collections are reported in the GC logs as "GCLocker Initiated GC":
 
<pre>
2017-02-14T03:51:33.209-0600: 670.666: [GC pause (GCLocker Initiated GC) (young), 0.0326740 secs]
    ...
</pre>


==GCLocker Initiated GC==
===G1 Humongous Allocation===


"GCLocker Initiated GC" is a collection triggered when a JNI critical region was released. Garbage collection is blocked when any thread is in the JNI Critical region. If garbage collection was requested during that period, that garbage collection is invoked after all the threads come out of the JNI critical region.
A  [[#Collection|collection]]  is triggered when a humongous object allocation fails. These collections are reported in the GC logs as "G1 Humongous Allocation":


==Metadata GC Threshold==
<pre>
2017-02-14T04:02:06.690-0600: 1304.097: [GC pause (G1 Humongous Allocation) (young) (initial-mark), 0.0800982 secs]
    ...
</pre>


"Metadata GC Threshold" is a collection triggered because the metadata space usage is over some threshold. We should not see this if ClassUnloadingWithConcurrentMark is enabled.
===Heap Dump===


==G1 Humongous Allocation==
A  full [[#Collection|collection]]  is triggered by a heap dump. These collections are reported in the GC logs as "Heap Dump Initiated GC".


GC is triggered when allocating humongous object failed.
===System.gc()===


==G1 Humongous Allocation==
A [[#Collection|collection]]  is triggered by a <tt>System.gc()</tt> call.


"Heap Dump Initiated GC": full gc is triggered by heap dump request.
==Evacuation==


==Allocation Failure==
The ''evacuation'' is the process of copying live objects from one G1 region to another. An "evacuation" collection is the most common type of young and mixed generation collection, where all the application threads are stopped and the GC system copies live objects across G1 regions.


GC is triggered to satisfy allocation failure.
=Configuration=


Enabled with:


<pre>
-XX:+UseG1GC
</pre>


==Evacuation==
=TODO=


The ''evacuation'' is the process of copying live objects from one G1 region to another. An "evacuation" collection is the most common type of young and mixed generation collection, where all the application threads are stopped and the GC system copies live objects across G1 regions.
* Process http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html

Latest revision as of 02:08, 22 April 2017

External

Internal

Overview

Evacuation is the process of copying live data from Young regions into Survivor regions (or free regions that thus become Survivors). During an Evacuation, all application threads are stopped.

Log marker:

[GC pause (G1 Evacuation Pause) (young), 0.7919126 secs]

Eden.


Spaces:

  • Young (or Eden)
  • Survivor
  • Old Generation


Metaspace

Process https://blogs.oracle.com/g1gc/entry/g1_gc_glossary_of_terms

Concepts

Collection

A collection gains the exclusive access of the heap and stops all application threads.

The collection can be "young", where only young and survivor regions are touched, or "mixed", where the collection includes young, survivor and old regions.

Collection Triggers

Allocation Failure

The main trigger for collection events, both young or mixed, is an object allocation failure. What does that mean? These collections are reported in the GC logs as "G1 Evacuation Pause":

2017-02-14T03:40:26.897-0600: 4.347: [GC pause (G1 Evacuation Pause) (young), 0.1014594 secs]
    ...

Metaspace Threshold Reached

A collection is triggered when metadata space usage reaches a threshold. This should not bee seen if ClassUnloadingWithConcurrentMark is enabled. These collections are reported in the GC logs as "Metadata GC Threshold":

2017-02-14T03:40:58.787-0600: 36.237: [GC pause (Metadata GC Threshold) (young) (initial-mark), 0.3979489 secs]
    ...

GCLocker Initiated GC

A collection is triggered when a JNI critical region was released. Garbage collection is blocked when any thread is in the JNI Critical region. If garbage collection was requested during that period, that garbage collection is invoked after all the threads come out of the JNI critical region.These collections are reported in the GC logs as "GCLocker Initiated GC":

2017-02-14T03:51:33.209-0600: 670.666: [GC pause (GCLocker Initiated GC) (young), 0.0326740 secs]
    ...

G1 Humongous Allocation

A collection is triggered when a humongous object allocation fails. These collections are reported in the GC logs as "G1 Humongous Allocation":

2017-02-14T04:02:06.690-0600: 1304.097: [GC pause (G1 Humongous Allocation) (young) (initial-mark), 0.0800982 secs]
    ...

Heap Dump

A full collection is triggered by a heap dump. These collections are reported in the GC logs as "Heap Dump Initiated GC".

System.gc()

A collection is triggered by a System.gc() call.

Evacuation

The evacuation is the process of copying live objects from one G1 region to another. An "evacuation" collection is the most common type of young and mixed generation collection, where all the application threads are stopped and the GC system copies live objects across G1 regions.

Configuration

Enabled with:

-XX:+UseG1GC

TODO