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

Ioi Lam iklam at openjdk.java.net
Fri Aug 6 20:15:59 UTC 2021


On Fri, 6 Aug 2021 12:51:08 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> 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.

Thanks @fparain and @mlchung for the review.

-------------

PR: https://git.openjdk.java.net/valhalla/pull/525


More information about the valhalla-dev mailing list