jdk17u-dev icon indicating copy to clipboard operation
jdk17u-dev copied to clipboard

8306444: Don't leak memory in PhaseChaitin::PhaseChaitin

Open jyma22 opened this issue 4 months ago • 5 comments

Hi all,

This pull request contains a backport of commit b2ccc97 from the openjdk/jdk repository.

The commit being backported was authored by Johan Sjölen on Apr 24 2023 and was reviewed by Vladimir Kozlov and Roland Westrelin.

Thanks!


Progress

  • [x] Change must not contain extraneous whitespace
  • [ ] JDK-8306444 needs maintainer approval
  • [x] Commit message must refer to an issue

Issue

  • JDK-8306444: Don't leak memory in PhaseChaitin::PhaseChaitin (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3992/head:pull/3992
$ git checkout pull/3992

Update a local copy of the PR:
$ git checkout pull/3992
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3992/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3992

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3992.diff

jyma22 avatar Sep 25 '25 20:09 jyma22

Hi @jyma22, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user jyma22" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

bridgekeeper[bot] avatar Sep 25 '25 20:09 bridgekeeper[bot]

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

openjdk[bot] avatar Sep 25 '25 20:09 openjdk[bot]

/signed

jyma22 avatar Sep 25 '25 20:09 jyma22

Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

bridgekeeper[bot] avatar Sep 25 '25 20:09 bridgekeeper[bot]

This backport pull request has now been updated with issue from the original commit.

openjdk[bot] avatar Oct 29 '25 17:10 openjdk[bot]

⚠️ @jyma22 This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

openjdk[bot] avatar Nov 17 '25 19:11 openjdk[bot]

Webrevs

mlbridge[bot] avatar Nov 17 '25 19:11 mlbridge[bot]

@jyma22 usage: /approval [<id>] (request|cancel) [<text>]

openjdk[bot] avatar Nov 17 '25 19:11 openjdk[bot]

/approval request optimizes PhaseChaitin's memory usage by freeing temporary sorting arrays early and eliminating the _blks array allocation by consolidating sorted blocks directly into the first bucket using memmove

jyma22 avatar Nov 17 '25 19:11 jyma22

@jyma22 8306444: The approval request has been created successfully.

openjdk[bot] avatar Nov 17 '25 19:11 openjdk[bot]

Fix Request 17u

Backporting this patch optimizes PhaseChaitin's memory usage by freeing temporary sorting arrays early and eliminating the _blks array allocation by consolidating sorted blocks directly into the first bucket using memmove. Path applies cleanly to 17u and doesn't require adjustments. Included test passes. Ran tier1.

jyma22 avatar Nov 20 '25 17:11 jyma22