Why you think the time is spent in GC? It sounds like the malloc implementation is trying to defragment memory on free(). The current GC has quadratic cost while allocating objects but it does not for deallocating objects. Can you try adding "gc.disable()" to the beginning of your program and see if the problem goes away? Neil