Skip to content

Conversation

@earthling-amzn
Copy link
Contributor

@earthling-amzn earthling-amzn commented Dec 13, 2025

The generational mode for Shenandoah will collect referents for the generation being collected. For example, if we have a young reference pointing to an old referent, that young reference will be processed after we finish marking the old generation. This presents a problem for discovery.

When the young mark encounters a young reference with an old referent, it cannot discover it because old marking hasn't finished. However, if it does not discover it, the old referent will be strongly marked. This, in turn, will prevent the old generation from clearing the referent (if it even reaches it again during old marking).

To solve this, we let young reference processing discover the old reference by having it use the old generation reference processor to do so. This means the old reference processor can have a discovered list that contains young weak references. If any of these young references reside in a region that is collected, old reference processing will crash when it processes such a reference. Therefore, we add a method heal_discovered_lists to traverse the discovered lists after young evacuation is complete. The method will replace any forwarded entries in the discovered list with the forwardee.

This PR also extends whitebox testing support for Shenandoah, giving us the ability to trigger young/old collections and interrogate some properties of heaps and regions.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8373203: Genshen: Non-strong reference leak in old gen (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28810/head:pull/28810
$ git checkout pull/28810

Update a local copy of the PR:
$ git checkout pull/28810
$ git pull https://git.openjdk.org/jdk.git pull/28810/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28810

View PR using the GUI difftool:
$ git pr show -t 28810

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28810.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 13, 2025

👋 Welcome back wkemper! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 13, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Dec 13, 2025
@openjdk
Copy link

openjdk bot commented Dec 13, 2025

@earthling-amzn The following labels will be automatically applied to this pull request:

  • hotspot
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 13, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 13, 2025

Webrevs

@earthling-amzn earthling-amzn marked this pull request as draft December 15, 2025 16:41
@openjdk openjdk bot removed the rfr Pull request is ready for review label Dec 15, 2025
@openjdk
Copy link

openjdk bot commented Dec 15, 2025

@earthling-amzn this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout fix-old-reference-processing
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Dec 15, 2025
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Dec 16, 2025
@earthling-amzn earthling-amzn marked this pull request as ready for review December 16, 2025 19:39
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 16, 2025
Copy link
Member

@stefank stefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few style proposals to make the Shenandoah sections look more consistent with the surrounding style in the shared code.

Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review shenandoah shenandoah-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants