From: Justin Johnson Date: 2002-08-24T04:19:08+09:00 Subject: Re: Why Ruby Uses Mark-and-Sweep GC? It certainly used to be the belief that moving collectors are better than mark and sweep although I'm not sure if this viewpoint is generally holding now. I read somewhere that a number of studies have shown that moving collectors can have worse virtual memory and caching behaviour. I've decided to stick with mark and sweep because I don't like the idea of copying lots of memory about for reasonable sized objects. Generations help by reducing the amount of live data to scan but there's no reason why mark and sweep can't be generational too. In fact, this is the approach I've taken. A bit of work is needed to avoid fragmentation but it's not been too difficult. -- Justin Johnson "Perry E. Metzger" wrote in message news:874rdlxxi5.fsf@snark.piermont.com... > > Dan Sugalski writes: > > At 1:18 AM +0900 8/24/02, William Djaja Tjokroaminata wrote: > > >I think one of the problems with reference counting is the circular > > >reference, which cannot be handled by the gc. > > > > That's one problem. Reference counting is also more expensive over > > the long run than more automatic methods. Also more error-prone. > > There are, of course, better gc's than mark and sweep -- compacting > collectors and generational compacting collectors come to > mind. Writing an implementation that deals with a compacting collector > can be a royal pain though -- you never know when an object will get > moved out from under you. > > Perry