A couple garbage collector questions

Joshua Marshall jmarshal at mathworks.com
Wed Apr 4 15:45:51 EDT 2001


Samuel A. Falvo II <kc5tja at garnet.armored.net> wrote:

> I really like the stop and copy collector theory, but they have practical
> disadvantages that significantly impact runtime performance.

> First, you need to perform a memory to memory copy of each object that is
> referenced.  Because of this, a large amount of time is spent moving chunks
> of memory.  On the other hand, you pretty much never need to worry about
> memory fragmentation.

Depending on the language (and specifically the piece of code),
copying collectors can be a performance win.  Since you never have to
touch garbage, code that allocates many small chunks of memory to be
used briefly can benefit.  But of course Python doesn't have the
equivalent of cons cells.  Unless you want to count something like
"(1, (2, (3, ())))".



More information about the Python-list mailing list