In brief
In CPython, gc controls a collector that supplements reference counting. Objects referring to one another can need this additional detection once they are unreachable.
Useful to know
In CPython, gc controls a collector that supplements reference counting. Objects referring to one another can need this additional detection once they are unreachable. [1]
Calling collect() is not a universal cure for memory growth. If the program still retains references, the objects have not become garbage. Investigate who owns the data before forcing collection after every operation.
Sources
For further detail and to check the information: