JDK-8343782 : G1: Use one G1CardSet instance for multiple old gen regions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-11-07
  • Updated: 2025-03-13
  • Resolved: 2025-02-07
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 25
25 b10Fixed
Related Reports
Causes :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
We currently have a 1:1 mapping of region remembered sets and G1CardSet instances, this means that the total remembered set may get very large just by the fact of having many regions and many inter-region pointers.

However, at each mixed-gc, depending on the G1MixedGCCountTarget, certain regions have to be collected together.  With this in mind, we may have these regions share a single instance of G1CardSet. This can decrease the number of inter-remembered set pointers significantly for regions that will be collected at the same time.

The expected benefit is reduction in the memory overhead of the remembered set and the remembered set merge time during collection pause. 

The one disadvantage is that this decreases the flexibility during evacuation slightly: you can only evacuate all regions that share a particular G1CardSet at once.
Comments
Seems this change triggered JDK-8349783 jdk/src/hotspot/share/gc/g1/g1RemSetSummary.cpp:344:68: runtime error: member call on null pointer of type 'struct G1HeapRegion' #0 0x7fff9806fb18 in HRRSStatsIter::print_summary_on(outputStream*) src/hotspot/share/gc/g1/g1RemSetSummary.cpp:344 #1 0x7fff9806d430 in G1RemSetSummary::print_on(outputStream*, bool) src/hotspot/share/gc/g1/g1RemSetSummary.cpp:396 #2 0x7fff9801b35c in G1RemSet::print_summary_info() src/hotspot/share/gc/g1/g1RemSet.cpp:1677 #3 0x7fff97d91c5c in G1CollectedHeap::print_tracing_info() const src/hotspot/share/gc/g1/g1CollectedHeap.cpp:2175 #4 0x7fff9844f5a0 in before_exit(JavaThread*, bool) src/hotspot/share/runtime/java.cpp:511 #5 0x7fff98826910 in JVM_Halt src/hotspot/share/prims/jvm.cpp:429 #6 0x7fff9e07b8c0 in Java_java_lang_Shutdown_halt0 src/java.base/share/native/libjava/Shutdown.c:41 #7 0x7fff7b7cd4dc (<unknown module>)
11-02-2025

Changeset: 86cec4ea Branch: master Author: Ivan Walulya <iwalulya@openjdk.org> Date: 2025-02-07 10:22:23 +0000 URL: https://git.openjdk.org/jdk/commit/86cec4ea2c2c56f03b23be44caade49b922cd3c6
07-02-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22015 Date: 2024-11-11 13:58:36 +0000
11-11-2024