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

8272041: [lworld] CDS heap dump fails with primitive objects #525

Conversation

iklam
Copy link
Member

@iklam iklam commented Aug 6, 2021

Two simple fixes to handle primitive objects when dumping the CDS heap:

  • When dumping the objects, we enter them into a hashtable. Do not use oopDesc::identity_hash() as the hashcode for this table.
  • When resetting the header of archived objects, do not call oopDesc::identity_hash() on primitive objects.

Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8272041: [lworld] CDS heap dump fails with primitive objects

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/525/head:pull/525
$ git checkout pull/525

Update a local copy of the PR:
$ git checkout pull/525
$ git pull https://git.openjdk.java.net/valhalla pull/525/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 525

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/525.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 6, 2021

👋 Welcome back iklam! A progress list of the required criteria for merging this PR into lworld 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 Aug 6, 2021

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

8272041: [lworld] CDS heap dump fails with primitive objects

Reviewed-by: fparain, mchung

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 no new commits pushed to the lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 6, 2021

Webrevs

fparain
fparain approved these changes Aug 6, 2021
Copy link
Collaborator

@fparain fparain left a comment

Looks good to me.

Just a question by curiosity, using object addresses instead of the identity hash code is likely to change the distribution of keys for the hashtable (all objects being in the same memory area and being aligned on heap words, some bits in their addresses are the same for all objects). Is it going to have a significant impact of the performance of the hashtable or is it negligeable?

Thank you,

Fred

mlchung
mlchung approved these changes Aug 6, 2021
Copy link
Member

@mlchung mlchung left a comment

Looks good. I verified with the patch that converts some JDK classes to ref-default primitive class.

@iklam
Copy link
Member Author

@iklam iklam commented Aug 6, 2021

Looks good to me.

Just a question by curiosity, using object addresses instead of the identity hash code is likely to change the distribution of keys for the hashtable (all objects being in the same memory area and being aligned on heap words, some bits in their addresses are the same for all objects). Is it going to have a significant impact of the performance of the hashtable or is it negligeable?

Hi Fred,

Thanks for the review. I've added code to calculate the stats of the hashtable. The max number of entries per bucket is no more than 3, so I think the distribution is acceptable.

Also, the hash function already shifts down by LogBytesPerWord, so it will get rid of the lower 3 zero bits.

My stats code is in https://github.com/iklam/valhalla/commits/heap-shared-seen-obj-table-stats, but it's not part of this PR. I will clean it up and integrate into jdk/jdk.

@iklam
Copy link
Member Author

@iklam iklam commented Aug 6, 2021

Thanks @fparain and @mlchung for the review.
/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Aug 6, 2021

Going to push as commit a8994ba.

@openjdk openjdk bot closed this Aug 6, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Aug 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 6, 2021

@iklam Pushed as commit a8994ba.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@fparain
Copy link
Collaborator

@fparain fparain commented Aug 6, 2021

Ioi,

Thank you for the additional effort to measure statistics of the hashtable.

Fred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants