• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. HotSpot
  4. CDS Archived Heap Improvements

CDS Archived Heap Improvements

  • Created by Ioi Lam on Oct 28, 2020

Overview

In the JDK 16 and 17 timeframe, we plan to enhance the CDS Archived Heap to implement the following:

  • Fix GC bug in G1 (JDK-8253081)to support archiving the full module graph (https://bugs.openjdk.java.net/browse/JDK-8244778)
    • This requires the Archived Heap to maintain a Root List.
  • Support CDS Archived Heap for other collectors
    • Phase 1: ParallelGC and SerialGC (which support compressed oops)
    • Phase 2: ZGC (which requires non-compressed oops)

As shown below, the Root List makes it easy to support other collectors.

Archived Heap in JDK 15

This section describes the implementation, and the problems, of the Archived Heap in JDK 15.

In JDK 15, the Archived Heap is supported only by G1 with compressed oops. Other types of GC are not supported. Uncompressed oops are not supported.

The Archived Heap is divided into two parts

  • Closed Region: Objects in this region can point to only other objects in this region. Today this region is used to store the archived String objects and their corresponding character arrays.
    • Objects in this region are alive forever. They are never collected.
    • Objects in this region are immutable.
  • Open Region: All other archived objects are stored in this region.
    • Objects in this region can reference any objects (including those that are outside of the Archived Heap).
    • Objects in this region are alive forever. They are never collected.

The Open Region is problematic:

  • It contains objects that are not reachable at VM bootstrap, but may become reachable later.
    • For example, archived mirror objects (instances of java.lang.Class) are stored in the Open Region. An archived mirror become reachable only when its corresponding C++ Klass object is loaded by the SystemDictionary.
  • As a result, G1 cannot conclude that an archived object is garbage just because it's unreachable.
  • Moreover, there's no way for G1 to distinguish between unreachable objects that
    • A: will later become reachable
    • B: were once reachable, but have become unreachable

Luckily, in JDK 15, all unreachable objects in the Open Region are of type A. I.e., once we have made an archived object reachable, it will always be reachable.


Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 134, "requestCorrelationId": "6989beb5b2a4e9c4"}