Skip to content
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

Closed

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Oct 22, 2020

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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/808/head:pull/808
$ git checkout pull/808

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 22, 2020

👋 Welcome back tschatzl! 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 openjdk bot commented Oct 22, 2020

@tschatzl The following label will be automatically applied to this pull request:

  • hotspot

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

@openjdk openjdk bot added the hotspot label Oct 22, 2020
@tschatzl tschatzl marked this pull request as ready for review Oct 23, 2020
@openjdk openjdk bot added the rfr label Oct 23, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 23, 2020

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;
}
Copy link
Member

@albertnetymk albertnetymk Oct 29, 2020

Choose a reason for hiding this comment

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

  1. FreeHeap makes more sense to me, since the allocation sites uses AllocateHeap.
  2. Why resetting those fields to zero? The only resource we need to release in this destructor is memory, right?

Copy link
Contributor Author

@tschatzl tschatzl Oct 29, 2020

Choose a reason for hiding this comment

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

  1. Will fix.
  2. 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.

Copy link
Member

@albertnetymk albertnetymk left a comment

Thank you for the change.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 29, 2020

@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:

8255232: G1: Make G1BiasedMappedArray freeable

Reviewed-by: ayang, kbarrett

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 master branch:

  • 9e5bbff: 8255550: x86: Assembler::cmpq(Address dst, Register src) encoding is incorrect
  • 5b18558: 8255243: Reinforce escape barrier interactions with ZGC conc stack processing
  • faf23de: 8255534: Shenandoah: Fix CmpP optimization wrt native-LRB
  • 579e50b: 8255564: InterpreterMacroAssembler::remove_activation() needs to restore thread right after VM call on x86_32
  • 4b20e46: 8255579: x86: Use cmpq(Register,Address) in safepoint_poll
  • 72ff8e2: 8254782: Fix benchmark issues in java/lang/StringIndexOfChar.java benchmark
  • ea26ff1: 8247614: java/nio/channels/DatagramChannel/Connect.java timed out
  • 38574d5: 8255298: Remove SurvivorAlignmentInBytes functionality
  • 4031cb4: 8254189: Improve comments for StackOverFlow and fix in_xxx() functions
  • caec8d2: 8233560: [TESTBUG] ToolTipManager/Test6256140.java is failing on macos
  • ... and 101 more: https://git.openjdk.java.net/jdk/compare/ae72b5283b5b5eee0fbb6c9121494a4e65fb381c...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Oct 29, 2020
@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Oct 29, 2020

Thanks @albertnetymk @kimbarrett for your reviews.

/integrate

@openjdk openjdk bot closed this Oct 29, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 29, 2020
@tschatzl tschatzl deleted the 8255232-freeable-g1biasedmappedarray branch Oct 29, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Oct 29, 2020

@tschatzl Since your change was applied there have been 111 commits pushed to the master branch:

  • 9e5bbff: 8255550: x86: Assembler::cmpq(Address dst, Register src) encoding is incorrect
  • 5b18558: 8255243: Reinforce escape barrier interactions with ZGC conc stack processing
  • faf23de: 8255534: Shenandoah: Fix CmpP optimization wrt native-LRB
  • 579e50b: 8255564: InterpreterMacroAssembler::remove_activation() needs to restore thread right after VM call on x86_32
  • 4b20e46: 8255579: x86: Use cmpq(Register,Address) in safepoint_poll
  • 72ff8e2: 8254782: Fix benchmark issues in java/lang/StringIndexOfChar.java benchmark
  • ea26ff1: 8247614: java/nio/channels/DatagramChannel/Connect.java timed out
  • 38574d5: 8255298: Remove SurvivorAlignmentInBytes functionality
  • 4031cb4: 8254189: Improve comments for StackOverFlow and fix in_xxx() functions
  • caec8d2: 8233560: [TESTBUG] ToolTipManager/Test6256140.java is failing on macos
  • ... and 101 more: https://git.openjdk.java.net/jdk/compare/ae72b5283b5b5eee0fbb6c9121494a4e65fb381c...master

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot integrated
3 participants