Our preliminary measurement show the patch introduced about ~5% speed up
for jmap �Chisto when iterate ~13GB committed heap. ( with �CXX:+UseG1GC 
�CXmx180g configured)

Just FYI.

Cheers,
Lin

From: 臧琳
Sent: Monday, December 10, 2018 2:24 PM
To: serviceability-dev@openjdk.java.net
Subject: optimize KlassInfoTable size to power of 2

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

Reply via email to