Le 24/01/11 13:45, Damien Doligez a écrit : > On 2011-01-22, at 17:29, Christophe Raffalli wrote: > >> for instance. They will become unreachable by the GC at the same cycle. >> However, >> if they are both added in a weak array, it seems that they may not be >> removed at the same time from the array. >> >> I have some code that seems to show that most of the time they are >> removed at the same times, but very rarely this fails. > As far as I can tell, it should never happen. Do you have a good > repro case? Hello, I will try to investigate further my example to make sure it is not another problem. If I get a simple repro case, I will post it. What I was considering recently (after my second post) is the following scenario: t and u are two inaccessible mutually recursive values, but one is still in the minor heap (t) while the other (u) has been promoted (if a minor cycle just ended between the allocation of both values, this seems possible even if unlikely). In this case, the finalisation of t and its removal from a weak array might occur long before the finalisation of u ? Cheers, Christophe