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
8252104: parallel heap inspection for ShenandoahHeap #67
Conversation
👋 Welcome back lzang! A progress list of the required criteria for merging this PR into |
@linzang The following labels will be automatically applied to this pull request: 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 add "serviceablility" |
@linzang Usage:
|
/label add serviceability |
@linzang |
Webrevs
|
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.
Thanks, this looks interesting.
I need more time to digest this. It feels like we can merge together the parallel (new) and serial (old) heap iteration code for better maintainability. I could try to do so later.
Thanks @shipilev, This is shenandoah support based on parallel heap inspection enabling in serviceability (tracked with https://bugs.openjdk.java.net/browse/JDK-8215624). hope it is helpful for your review. |
Hi @shipilev, |
Thank you, we'll take a look next week. |
Hi Lin,
|
Hi @zhengyu123 , |
Looks good to me. Thanks. |
@linzang This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements After integration, the commit message will be:
Since the source branch of this PR was last updated there have been 148 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 automatic rebasing, please merge As you do not have Committer status in this projectan existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@shipilev, @zhengyu123) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
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.
Sorry for the delay! I think there is a concurrency bug in using Stack
from multiple threads. Plus, there are a bunch of stylistic nits.
if (!_aux_bitmap_region_special && !os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size())) { | ||
log_warning(gc)("Could not uncommit native memory for auxiliary marking bitmap for heap iteration"); | ||
// Reset bitmap | ||
_aux_bit_map.clear(); |
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.
Wait a sec, we have just uncommitted the aux bitmap, so clear()
is bound to crash?
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.
No, here the aux_bit_map.clear() is called after commit_memory(), so clear() is safe to reset the bitmap.
the uncommit_memory() was moved to reclaim_aux_bitmap_for_iteration() at line 1354
Dear @shipilev, -Lin |
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.
Thanks, this looks very good. I have only a few minor stylistic leftovers. Other than that, it seems ready to integrate.
} | ||
}; | ||
|
||
ParallelObjectIterator* ShenandoahHeap::parallel_object_iterator(uint num_workers) { |
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.
num_workers
-> workers
@@ -549,6 +556,8 @@ class ShenandoahHeap : public CollectedHeap { | |||
|
|||
// Used for native heap walkers: heap dumpers, mostly | |||
void object_iterate(ObjectClosure* cl); | |||
// Parallel heap iteration support | |||
virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num); |
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.
thread_num
-> workers
@@ -524,6 +527,10 @@ class ShenandoahHeap : public CollectedHeap { | |||
// Prepare and finish concurrent unloading | |||
void prepare_concurrent_unloading(); | |||
void finish_concurrent_unloading(); | |||
// Heap iteration support | |||
void scan_roots_for_iteration(Stack<oop, mtGC>* oop_stack, ObjectIterateScanRootClosure* oops); |
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.
Let's typedef Stack<oop, mtGC> ShenandoahScanRootStack
and use it everywhere?
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.
As this Stack is also used for iterating all objects (not only roots), so I took the liberty to rename it to ShenandoahScanObjectStack :)
- enable parallel heap inspecton for ShenandoahHeap - preliminary evaluation: Time of jmap histo on (8GB heap with 4GB objects) * before: 5.186s * after : 1.698s
Dear @shipilev, |
/integrate |
Thank you, this looks good. I'll run a few local test and then sponsor. |
/sponsor |
@shipilev @linzang Since your change was applied there have been 148 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 34ec1be. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Time of jmap histo on (8GB heap with 4GB objects)
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/67/head:pull/67
$ git checkout pull/67