This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Someone registers thousands of Object's and MethodRef's (was/is: gc times doubling)


MEN> Suddenly the array increases its length from some 21.000 to (approx) MEN> eight times the length - namely 170.000.
MEN> This increases my GC times with some 200ms.
Sounds related to this:
http://gcc.gnu.org/ml/java/2004-11/msg00153.html
Arrghh!! It's more than related - it is identical to that posting! :-)
Hahhahaha! I feel like such a fool - rediscovering a 2 year old bug!

So, it looks like just fixing that bug will make the increase go from only 20k to 40k, and only increasing my GC times by additional 20ms instead of ~160ms.

I guess, further optimisations could be put in, as well.
Why should we increase the table from 21504 to the double when only 8000 entries are inside?
I can see the algorithm dictates so:


Double when:
 size > threshold
 threshold = table.length / 2 * 0.75 (~8000 with size 21k)

I would consider making this different, or disabling the registration of MethodRef, at all. Or maybe only do partial caching: only cache the MethodRef actually being used!

Thanks Rutger for pointing to this,
 Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]