From: Justin Johnson Date: 2002-09-04T09:24:16+09:00 Subject: Re: Best GC for Ruby? Marking is the process of flagging live data. When using C/C++, it's common to pass pointers to functions/methods and the data that the pointers point to needs to be recognized as live. A common solution to this is to iterate through the C/C++ stack treating each stack element as a potential pointer. There are some good checks you can do to discount stack elements that aren't pointers. The sweeping traditionally sweeps all data and reclaims any data not marked as live. In my case, I allocate memory in pages of 4k and can do some quick checks to see if an entire page can be reclaimed in one go. There's a few other tricks you can use to make this process fast. It sounds like you might be thinking about whats classically termed 'generations'. This is a technique employed to reduce the amount of work done in common garbage collections. And this is where I've got a problem. You need to track pointers within objects that point to data in other generations. To do this in software means you need to adopt a method of monitoring inter-generational pointer changes which is what the previous posting is all about. -- Justin Johnson "William Djaja Tjokroaminata" wrote in message news:al38aq$l43$2@grapevine.wam.umd.edu... > Hi Justin, > > Please excuse me on my lack of knowledge regarding the GC model. When we > talk about the "roots", does it mean only roots for marking, or does it > mean roots for both marking and sweeping? (In the current Ruby GC, I > think the roots are used for marking, while sweeping just goes through the > whole heaps/array.) Is it possible to have separate sweeping areas? > > Regards, > > Bill