-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8255232: G1: Make G1BiasedMappedArray freeable #808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8255232: G1: Make G1BiasedMappedArray freeable #808
Conversation
|
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
Webrevs
|
| if (_alloc_base != NULL) { | ||
| FREE_C_HEAP_ARRAY(u_char, _alloc_base); | ||
| _alloc_base = NULL; | ||
| _base = NULL; | ||
| _length = 0; | ||
| _biased_base = NULL; | ||
| _bias = 0; | ||
| _shift_by = 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreeHeapmakes more sense to me, since the allocation sites usesAllocateHeap.- Why resetting those fields to zero? The only resource we need to release in this destructor is memory, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Will fix.
- Some debugging code to see if anyone else is using it after the freeing as previously these tables were never freed - I was not sure if I should keep them or not so I want to see if anyone would complain :) I'll remove these then.
albertnetymk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the change.
|
@tschatzl This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 111 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
Thanks @albertnetymk @kimbarrett for your reviews. /integrate |
|
@tschatzl Since your change was applied there have been 111 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 5c520c3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi all,
can I have reviews for this change that makes G1BiasedMappedArray freeable?
Previously all G1BiasedMappedArray were created as unfreeable i.e. assigned to static variables. However with JDK-8253600 I need one such biased map for the full collector which is created and deleted during full GC. So the biased array should also be freed as necessary to avoid a memory leak.
The alternative would be to statically allocate that map anyway and provide it to the current G1FullCollector instance, but I do not think the single malloc call is perf sensitive compared to full collector work and there is much point in doing something more complicated at this time. In the future I hope that the young gen collector will also be extracted from G1CollectedHeap with the same need. If/when allocation of these helper data structures becomes a problem I would suggest looking into this again.
One option then could be using some ResoureArea for these things in the future.
For this change there should be no change in behavior at all.
Testing: tier1-5
Thanks,
Thomas
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/808/head:pull/808$ git checkout pull/808