RFR: Reset update watermark for cycles degenerated during evacuation

William Kemper wkemper at openjdk.java.net
Wed Mar 2 17:04:59 UTC 2022


When an out of memory error occurs during concurrent evacuation the load reference barrier (LRB) stops trying to evacuate objects (this appears to be by design). As the collector transitions to a degenerated cycle, mutators may load references to objects in the collection set. If one of these references is written into a region that was `empty committed` after final mark, the region will have its top at mark start (TAMS) and update watermark (UWM) equal to the bottom of the region. Such regions are effectively skipped during the update reference phase. The degenerated cycle completes with live references to reclaimed memory in the heap, resulting in crashes or corruption.

Rather than re-engineer the oom-during-evac protocol, upon entering a degenerated evacuation phase we again make thread local allocation buffers (TLABs) parsable and reset the UWM for active regions. Now, if the degenerated evacuation phase succeeds, the from-space pointers will be fixed in the update reference phase.

-------------

Commit messages:
 - Only retire tlabs if tlabs are in use
 - Reset update watermark (and make TLABs parsable) for cycles degenerated during evacuation

Changes: https://git.openjdk.java.net/shenandoah/pull/121/files
 Webrev: https://webrevs.openjdk.java.net/?repo=shenandoah&pr=121&range=00
  Stats: 21 lines in 1 file changed: 21 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/shenandoah/pull/121.diff
  Fetch: git fetch https://git.openjdk.java.net/shenandoah pull/121/head:pull/121

PR: https://git.openjdk.java.net/shenandoah/pull/121


More information about the shenandoah-dev mailing list