A 'Python like' language

Paul Rubin http
Mon Mar 29 15:04:25 EST 2004


"Mark Hahn" <mark at prothon.org> writes:
> That was a great read.  Thanks.  I'll have to chew on it.

Aside from those rather esoteric issues, pure mark/sweep gc has
traditionally worked best in smaller systems, since the "mark" phase
involves touching every live pointer in the whole system, which are
scattered through all of memory.  As the system keeps running, memory
gets more and more fragmented and cache and paging performance get
worse and worse.  Also, besides touching all the live objects in the
mark phase, you also have to touch all the garbage in the sweep phase.

With a stop-and-copy gc, you still have to touch all the data during
gc, but you don't have to touch the garbage.  Also, after the gc is
done, you've copied all the live data to a contiguous region, so it's
not fragmented any more.

Fancier (generational) schemes use mixed copying and mark/sweep
strategies to gc recently created objects the most often, etc.

Just as with numerical linear algebra or sorting or alpha-beta search,
there are simple gc techniques that work ok, but getting really high
performance is a well-studied subject with a lot of literature and
lore about it.  I believe Andrew Appel wrote a book or survey paper
on it in the early 90's that you might like to look at.



More information about the Python-list mailing list