8306444: Don't leak memory in PhaseChaitin::PhaseChaitin
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
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.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
/signed
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!
This backport pull request has now been updated with issue from the original commit.
⚠️ @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.
@jyma22 usage: /approval [<id>] (request|cancel) [<text>]
/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 8306444: The approval request has been created successfully.
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.