JDK-8215893 : Add better abstraction for pinning G1 concurrent marking bitmaps.
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 12
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2018-12-21
  • Updated: 2020-11-13
  • Resolved: 2020-11-13
Related Reports
Relates :  
Relates :  
Description
In the linked issue - JDK-8211425, G1 concurrent marking bitmaps are pinned in memory by calling commit_and_set_special() which was added as part of its implementation.

A better approach would be to create pinned bitmaps during their construction which is currently done in G1CollectedHeap::initialize(). Possible solution is to add an argument to constructors for G1RegionToSpaceMapper and G1PageBasedVirtualSpace.
Comments
This functionality has been removed in JDK-8256181.
13-11-2020

The reason for this pinning is that when allocating humongous object in old (NVDIMM) generation, we may need to uncommit free regions and the associated data structures (e.g. bitmaps) in the young gen to keep the total committed regions correct. Meanwhile clearing of the bitmaps for the next marking will access the bitmap again. The best way to fix this is to not clear the bitmaps of all regions, but only those that have a nTAMS > bottom() (a further optimization would be to only clear the area between bottom() and nTAMS() as this is the only area G1 will look at). And remove the current bitmap pinning code. I think the "clear mark bitmap for next marking" may need to move to the start of the marking process for this to work to make sure that the correct bitmaps were cleared when used in this marking
05-11-2019