From: David Masover Date: 2009-11-22T05:26:33+09:00 Subject: COW-friendly Ruby 1.9? Here's my test script: a = [] (1024**2*10).times do a << Object.new end puts 'allocated' gets GC.start puts "GC'd" gets GC.start unless fork puts "GC'd and sleeping" sleep 10 I'm using Ruby 1.9.1 from the Ubuntu Karmic repositories on x86_64. This seems to use about 600 megs once it's allocated. (I'm un-scientifically watching 'free -m' to see what happens.) If I don't do the second GC, the forked child doesn't use much more. When I do GC in the child, or in the parent after the fork, it pretty much exactly doubles -- another 600 megs. This is disappointing. After all the noise from Merb, Unicorn, Phusion, and "enterprise edition", and especially considering that forking is the only real way to make MRI scale to multiple cores, I'd have expected some sort of COW- friendly GC to have been merged already. Wasn't someone working on this somewhere back in 1.9.0? Or is there something wrong with my benchmark? I mean, it's clearly artificial, and I haven't tried comparing it to the various "enterprise edition" patches.