I looked at the traceback of the invariant call that shows the problem: it sees a stack object (the second one) which has used much much bigger than reserved. Do you mean the gc just before them (the last time the array size is increased)?