G1 garbage collection Ext Root Scanning time increases due to Class.forName (Problem, Solution, and Patch)

Thomas Schatzl thomas.schatzl at oracle.com
Fri Jul 12 00:22:44 PDT 2013


Hi,

On Thu, 2013-07-11 at 14:39 -0700, Ioi Lam wrote:
> While looking at this, I found a small optimization opportunity:
> 
>     void Dictionary::oops_do(OopClosure* f) {
>       for (int index = 0; index < table_size(); index++) {
>         for (DictionaryEntry* probe = bucket(index);
>                               probe != NULL && probe->pd_set() !=
> NULL;
>                               probe = probe->next()) {
>           probe->protection_domain_set_oops_do(f);
>         }
>       }
>     }
> 
> We can sort each bucket so that all the classes that do NOT have a
> protection domain are placed at the end of the list, so we can skip
> them
> easily. However, this won't save too much time, as the GC bottleneck
> (at least with the original test case) seems to be here:

  the CR at http://bugs.sun.com/view_bug.do?bug_id=8003420 comes to my
mind every time somebody is talking about system dictionary performance:
this might be a worthwhile change; during young gc we could then just
skip the rest of the bucket as soon as the PD is NULL....

Still the scanning time would be dependent on the number of buckets, so
if the allowable/typical bucket load is high, this might be worth
trying.

Just an idea,
Thomas





More information about the hotspot-runtime-dev mailing list