Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COW-friendly Ruby 1.9?

0 views
Skip to first unread message

David Masover

unread,
Nov 21, 2009, 3:26:33 PM11/21/09
to
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.

Jeremy Kemper

unread,
Nov 21, 2009, 4:14:14 PM11/21/09
to
On Sat, Nov 21, 2009 at 12:26 PM, David Masover <ni...@slaphack.com> wrote:
> 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?

See [ruby-core:19799] for a bitmap-marking GC patch.

jeremy

David Masover

unread,
Nov 21, 2009, 4:50:29 PM11/21/09
to

Yes, I saw that. Something about SEGV in make test -- and I really don't see
any follow-up to that. What's the status of getting something like this
actually in core and stable?

Ryan Davis

unread,
Nov 22, 2009, 4:33:53 AM11/22/09
to

You can help by re-asking this in ruby-core@


Yukihiro Matsumoto

unread,
Nov 22, 2009, 8:44:31 AM11/22/09
to
Hi,

In message "Re: COW-friendly Ruby 1.9?"


on Sun, 22 Nov 2009 05:26:33 +0900, David Masover <ni...@slaphack.com> writes:

|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.

The REE patch made Ruby so slow on some non-Web cases. AuthorNari
made the faster patch. But it's still (much) slower than the original
GC for non forking programs. Besides that, the patch had the serious
bug which we could not identify for long time.

Ko1 is working on improvement on Ruby's memory management (not GC).
We have good chance to make the GC COW friendly base on that
improvement. Stay tuned.

matz.

0 new messages