From: Rick DeNatale Date: 2009-12-12T12:40:20+09:00 Subject: [ruby-core:27150] Re: Ruby's GC On Fri, Dec 11, 2009 at 10:07 PM, Brian Mitchell wrote: > 2009/12/11 Gon�alo Silva : >> Then because of C extensions support the generational GC is not an option. >> What would then be the best algorithm for a GC for Ruby? Mark and don't >> sweep? A non-halting algorithm would be great. > > Generational collection can be done without coping/moving objects > around. Apple's Objective-C runtime has to deal with the same issues > for GC work and it seems like they've managed to get it working using > marking bits to denote generation and adapt to this during the marking > phases. Not ideal but it can work. I've wondered what it would take to > port the autozone library [0] over to Ruby 1.9... > > Brian. > > [0]: http://www.opensource.apple.com/source/autozone/ > > Interesting. But there are advantages to copying collectors, in that they tend to compact the active objects, and therefore keep working set sizes smaller, which generally leads to better performance in virtual memory systems. Working set size is also the reason why, in many circumstances, byte-code with or without JIT expansion, can outperform direct compilation to machine code. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale