Actually there are reference loops, and this is the only reason why manual calls gc.collect()can even restore memory.
Python ( CPython) , . , , .
, : http://docs.python.org/2/library/gc.html
TL;DR - , Python . (allocations - deallocations) 700 ( 0), , reset.
, ( gc.collect()), 0 ( , ) (.. , - , , , ). , , 1.
10 ( 1), 1, 1, , 2. 10 1 ( 100 - 2), 2. , , 2 - 3.
, gc.set_threshold(threshold0, threshold1, threshold2).
:
- GC , CPython (refcounting is). GC "" , .
- , , GC ,
MemoryError. - . .