optimize KlassInfoTable size to power of 2
臧琳
zanglin5 at jd.com
Mon Dec 10 06:24:01 UTC 2018
Dear All,
I am investigating JMap utility for large heap (~200GB) and found that
the current KlassInfoTable’s _num_buckets size(20011) may not be optimal.
My observation is that when “jmap histo” iterating objects , the object’s klass
is identified and then hash idx in KlassInfoTable’s buckets[] is calculated by mod
of _num_bucktes, which would issue a heavy instruction idiv on x86 platform. It
means for every object scanned, a idiv instruction is issued, which lag the performance espically when
there are large number of objects in heap. Hence if the _num_buckets can be changed to
a pow of 2, (e.g. 65536) the idiv can be replaced with a faster instruction such as shl (left bit shift),
And I have prepared a patch for this change.
My question is that why 20011 is used now? is there any special reason? And is there
any potential problem if I change the value to 65536, or 32768?
Thanks!
BRs,
Lin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20181210/34a3abfd/attachment.html>
More information about the serviceability-dev
mailing list