RFR: 8371783: Refactor GCCause in VM_CollectForMetadataAllocation [v2]

Joel Sikström jsikstro at openjdk.org
Wed Nov 19 16:11:42 UTC 2025


> Hello,
> 
> We should improve how we use and set GCCause in VM_CollectForMetadataAllocation to make it more clear when reading the code what is going on.
> 
> When constructing a VM_CollectForMetadataAllocation operation, we pass in a GCCause, which is not always the cause that is used, since we might also have to clear soft references as a last resort if earlier collection attemps is not enough to free up memory.
> 
> The GCCauseSetter at the start of this operation is also redundant as subsequent calls to initiate a GC set the cause themselves.
> 
> Testing:
> * Oracle's tier1-3

Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:

  Move heap variable down a bit

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28287/files
  - new: https://git.openjdk.org/jdk/pull/28287/files/25da0eef..4355bd66

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28287&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28287&range=00-01

  Stats: 4 lines in 1 file changed: 2 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28287.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28287/head:pull/28287

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


More information about the hotspot-gc-dev mailing list