This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Someone registers thousands of Object's and MethodRef's (was/is: gc times doubling)
- From: Martin Egholm Nielsen <martin at egholm-nielsen dot dk>
- To: java at gcc dot gnu dot org
- Date: Fri, 31 Mar 2006 17:05:28 +0200
- Subject: Re: Someone registers thousands of Object's and MethodRef's (was/is: gc times doubling)
- References: <e0h9l2$j84$1@sea.gmane.org> <815549421.20060331063620@eml.cc>
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