- Loading...
Author: Jiangli Zhou (jiangli), Thomas Schatzl (tschatzl)
Table of Contents |
---|
...
The archive-types are sub-types of 'pinned'. There are two types of archive region currently, open archive and closed archive. Both can support caching java Java heap objects via the CDS archive.An archive region is also an old region by design(Class Data Sharing) archive.
...
Open archive region does not have 'dead' objects. Unreachable objects are 'dormant' objects. Dormant objects are not collected and freed by GC. Please see Dormant Objects for details.
Caching java Java objects with open archive region may help JVM startup and runtime performance.
...
As GC can adjust pointers within the live objects in open archive heap region, objects can have outgoing pointers to another java Java heap region, including closed archive region, open archive region, pinned (or humongous) region, and normal generational region (young, old). When a referenced object is moved by GC, the pointer within the open archive region is updated accordingly.
...
The closed archive region is GC read-only region. GC cannot write into the region. Objects are not scanned and marked by GC. Objects are pinned and not forwarded. Pointers are not updated by GC either. Hence, objects within the archive region cannot have any outgoing pointers to another java Java heap region. Objects however can still have pointers to other objects within the closed archive regions (we might allow pointers to open archive regions in the future). That restricts the type of java Java objects that can be supported by the archive region.
Supported java Java objects:
In JDK 9 we added the support archive for shared Strings with the (closed) archive regions.
The GC-readonly archive region makes java Java heap memory sharable among different JVM processes.
NOTE: synchronization on the objects within the archive heap region can still cause writes to the memory page.
...
Dormant objects are unreachable java Java objects within residing in the open archive heap region(s).
A java Java object in the open archive heap region is a live object if it can be reached during scanning. Some of the java Java objects in the region may not be reachable during scanning. Those objects are considered as dormant, but not dead. For example, a constant pool 'resolved_references' array is reachable via the klass root if its container klass (shared) is already loaded at the time during GC scanning. If a shared klass is not yet loaded, the klass root is not scanned and it's constant pool 'resolved_reference' array (A) in the open archive region is not reachable. Then A is a dormant object.
All java Java objects are initially dormant objects when open archive heap regions are mapped to the runtime java Java heap. A dormant object becomes live object when the associated shared class is loaded at runtime. Explicit call to G1SATBCardTableModRefBS::enqueue() needs to be made when a dormant object becomes live. That should be the case for cached objects with strong roots as well, since strong roots are only scanned at the start of GC marking (the initial marking) but not during Remarking/Final marking. If a cached object becomes live during concurrent marking phase, G1 may not find it and mark it live unless a call to G1SATBCardTableModRefBS::enqueue() is made for the object.
...
Interned javaJava.lang.String objects and value objects
Class mirror objects (javaJava.lang.Class objects)
Class constant pool resolved_references arrays
...
The closed archive and open archive regions are allocated at the top (or near the top) of the dump time java Java heap. Archived java Java objects are copied into the designated archive heap regions. For example, String objects and the underlying 'value' arrays are copied into the closed archive regions. All references to the archived objects (from shared class metadata, string table, etc) are set to the new heap locations. A hash table is used to keep track of all archived java Java objects during the copying process to make sure java Java object is not archived more than once if reached from different roots. It also makes sure references to the same archived object are updated using the same new address location.
...
The closed archive regions (the string regions) and open archive regions are mapped to the runtime java Java heap at the same offsets as the dump time offsets from the runtime java Java heap base.
...