RFR: 8330981: ZGC: Should not dedup strings in the finalizer graph

Erik Österlund eosterlund at openjdk.org
Wed May 29 07:22:26 UTC 2024


The generic logic we have for deduplicating strings during marking in various GCs, relies on creating a phantom root to store strings to be deduplicated. When storing an oop into a phantom root, it is required that the oop is strongly reachable at that point. However, when ZGC marks through finalizers (as opposed to the strongly reachable graph), the oop has not been marked as strongly reachable, and hence it isn't really safe to create that phantom root.

The solution is quite simple, really. Just don't deduplicate strings when marking through the finalizer graph.

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

Commit messages:
 - 8330981: ZGC: Should not dedup strings in the finalizer graph

Changes: https://git.openjdk.org/jdk/pull/19444/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19444&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8330981
  Stats: 8 lines in 2 files changed: 4 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/19444.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19444/head:pull/19444

PR: https://git.openjdk.org/jdk/pull/19444


More information about the hotspot-gc-dev mailing list