2 ms·
Ref counting uses additional memory to store the refcounts. And possibly more for the suspected set of the cycle collector. GC uses additional memory to amorti
by sfink 7y ago
Ref counting uses additional memory to store the refcounts. And possibly more for the suspected set of the cycle collector.
GC uses additional memory to amortize collections over allocations. (Zero overhead means constantly collecting, using 2x steady state memory size is not uncommon.)
Overall, I think you're right, refcounting comes out ahead on memory usage. But it's not completely straightforward to determine.