[Jamvm-general] Hash entry scavenge problem.
Brought to you by:
rlougher
From: Dore <do...@do...> - 2007-04-04 18:01:55
|
Hi,=20 Yesterday I posted the message below as a bug on sourceforge, but from one of my collegues I just heard that Nabble is the place to be if the issue is JamVM. Therefor I also post it here. We are running jamVM on an platform with a limited amount of mutexes and due to that we have found minor error in the for-loop used for scavenging data in the hash-table. The error will not show on platforms with "unlimited" mutexes and is therefor probably not critical on most platforms. In hash.h line 97-98 there is a for-loop: int n; for (i=3D0, n=3Dtable.hash_count;n--;i++) { When using the macro in lock.c it loops through the mon_cache an moves some of the monitors over to a free_list. But as it only count the number of actually used entries it never "cleans" the top area of the mon_cache and therefore the hash_table is resized eventhough there is a number of entries that could have been reused. This leads to a leak in allocated mutexs and finally a system lock. We have fixed the problem in our application by correcting the for-loop to: for (i=3D0;i < table.hash_size;i++) { Best regards Mads Dor=C3=A9 dore at doredevelopment.dk --=20 View this message in context: http://www.nabble.com/Hash-entry-scavenge-pro= blem.-tf3527308.html#a9842246 Sent from the JamVM mailing list archive at Nabble.com. |