JDK-8210708 : Use single mark bitmap in G1
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-09-13
  • Updated: 2022-08-03
  • Resolved: 2022-07-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 20
20 b06Fixed
Related Reports
Blocks :  
Blocks :  
Blocks :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
The reason we need the second "complete" bitmap is that after class unloading (at Remark at this time) there will be objects that are not parseable in the old gen heap. We could make the heap parseable again by stuffing integer arrays into these places.

Previously we thought that iterating over the heap was too expensive to do, so g1 uses two bitmaps, the "prev" bitmap that contains current data, the "next" bitmap containing data for after completion of the marking, which are swapped at some point.

However, due to rebuild remset during concurrent cycle we already walk the heap.

So it might be useful to try this out: it would probably improve gc pause times (and refinement) too as then we would not need to ask the bitmap for liveness..

Implement and evaluate performance impact.

Advantages:
1.5% of Java heap memory saved
potential speedups during scanning cards (refinement, during GC)

Disadvantages:
additional concurrent BOT update
lengthens concurrent cycle

Comments
~[tschatzl] : out of curiosity, are there any before/after performance numbers for the change that you might be able to share here? Thanks!
09-07-2022

Changeset: 95e3190d Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2022-07-07 15:46:05 +0000 URL: https://git.openjdk.org/jdk/commit/95e3190d96424885707dd7d07e25e898ad642e5b
07-07-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8957 Date: 2022-05-31 14:43:14 +0000
31-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8956 Date: 2022-05-31 13:52:32 +0000
31-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8884 Date: 2022-05-25 14:40:39 +0000
25-05-2022

Moving the class unloading from the Remark into the Cleanup pause is actually not necessary. The main problem is concurrent refinement (reading from the heap) and the concurrent BOT update at the same time.
09-05-2022