JDK-8293650 : Shenandoah: Support archived heap objects
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-12
  • Updated: 2025-07-28
  • Resolved: 2024-08-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b12Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Opened on behalf of Ashutosh Mehra <asmehra at redhat.com>

As proposed in https://mail.openjdk.org/pipermail/hotspot-dev/2022-September/063837.html

....
Based on the changes done for supporting other policies (like Parallel) I
added following APIs:

- ShenandoahHeap::allocate_loaded_archive_space()
- ShenandoahHeap::can_load_archived_objects()

and tested it with "-XX:+UseShenandoahGC -Xlog:cds,cds+heap=info" options.
The logs show that the jvm is able to load the archived heap and use the
archived objects:

[0.047s][info][cds] Mapped static  region #2 at base 0x00007f7706699000 top
0x00007f77066d5000 (Bitmap)
[0.047s][info][cds] Loaded heap    region #5 at base 0x0000000611e00000 top
0x0000000611e78000 size 491520 delta 21776826368
[0.048s][info][cds] Loaded heap    region #3 at base 0x0000000611e78000 top
0x0000000611efa000 size 532480 delta 21776269312
[0.048s][info][cds] optimized module handling: enabled
[0.048s][info][cds] full module graph: enabled
[0.048s][info][cds] use_full_module_graph = true; java.base =
0x00000008004f46c0
[0.049s][info][cds] Unmapping region #2 at base 0x00007f7706699000 (Bitmap)
[0.077s][info][cds,heap] initialize_from_archived_subgraph
java.lang.Module$ArchivedData 0x000000080019ff10 (early)
[0.078s][info][cds,heap] initialize_from_archived_subgraph
java.util.ImmutableCollections 0x000000080018c190 (early)
[0.083s][info][cds,heap] initialize_from_archived_subgraph
java.lang.Integer$IntegerCache 0x0000000800048d58 (early)
[0.086s][info][cds,heap] initialize_from_archived_subgraph
java.lang.module.Configuration 0x0000000800193128 (early)
[0.086s][info][cds,heap] initialize_from_archived_subgraph
java.lang.ModuleLayer 0x0000000800162b68 (early)
[0.086s][info][cds,heap] Initializing Enum class:
java.lang.module.ModuleDescriptor$Requires$Modifier
[0.087s][info][cds,heap] initialize_from_archived_subgraph
jdk.internal.loader.ArchivedClassLoaders 0x00000008000fe280 (early)
[0.087s][info][cds,heap] initialize_from_archived_subgraph
jdk.internal.module.ArchivedBootLayer 0x000000080023cd40 (early)
[0.090s][info][cds,heap] initialize_from_archived_subgraph
sun.util.locale.BaseLocale 0x0000000800365660
[0.102s][info][cds,heap] initialize_from_archived_subgraph
java.lang.Long$LongCache 0x000000080004c180

I want to check if adding these two APIs is sufficient. Did I miss anything?
Comments
Changeset: d86e99c3 Branch: master Author: Aleksey Shipilev <shade@openjdk.org> Date: 2024-08-15 20:52:07 +0000 URL: https://git.openjdk.org/jdk/commit/d86e99c3ca94ee8705e44fe2830edd3ceb0a7f64
15-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20468 Date: 2024-08-05 16:32:09 +0000
05-08-2024

I am going to reassign this to myself then, thanks.
24-07-2024

[~shade~] > Ashutosh, are you planning to finish this? not really; don't have cycles for this now. > I implemented a variant of this while enabling Leyden for Shenandoah, I think we can just yank the implementation from there to mainline: That looks fine to me. Regarding the PR in leyden repo, I would suggest to share it via leyden-dev mailing list as the PRs are not monitored for the premain work, or directly push your changes to the premain branch if you have the access.
22-07-2024

Ashutosh, are you planning to finish this? I implemented a variant of this while enabling Leyden for Shenandoah, I think we can just yank the implementation from there to mainline: https://github.com/openjdk/leyden/pull/8
22-07-2024

Converting Shenandoah support of archived heap objects to a separate RFE.
21-06-2024