Copy-on-write


#1

Hi,

If a process is forked on Linux, which version of ruby is implemented
with the copy-on-write technique?


#2

On Mon, Mar 18, 2013 at 4:43 PM, Ken P. removed_email_address@domain.invalid wrote:

If a process is forked on Linux, which version of ruby is implemented
with the copy-on-write technique?

It sounds as if you were mixing OS and Ruby features. If the OS
implements this all processes benefit from it - regardless of
implementation.

Kind regards

robert


#3

On Mar 18, 2013, at 12:03 PM, Robert K. removed_email_address@domain.invalid
wrote:

It sounds as if you were mixing OS and Ruby features. If the OS
implements this all processes benefit from it - regardless of
implementation.

True, but ruby’s garbage collector up until 2.0.0-p0 used a mark and
sweep algorithm that completely obviated the capability of COW friendly
OS’s (because every object was ‘written’ during each GC run).

In 2.0.0-p0 the garbage collector is implemented in such a way as to
allow copy on write.

Links:

http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0

https://blog.heroku.com/archives/2013/3/6/matz_highlights_ruby_2_0_at_waza


#4

On Mon, Mar 18, 2013 at 6:13 PM, Robert Jackson
removed_email_address@domain.invalid wrote:

On Mar 18, 2013, at 12:03 PM, Robert K. removed_email_address@domain.invalid wrote:

It sounds as if you were mixing OS and Ruby features. If the OS
implements this all processes benefit from it - regardless of
implementation.

True, but ruby’s garbage collector up until 2.0.0-p0 used a mark and sweep
algorithm that completely obviated the capability of COW friendly OS’s (because
every object was ‘written’ during each GC run).

Good point! Maybe Ken was actually wondering about copy on write
friendly Ruby implementations even though the question sounded
different.

In 2.0.0-p0 the garbage collector is implemented in such a way as to allow copy
on write.

Well, pre 2.0 GC does not prevent copy on write - actually it makes
heavy use of copy on write. :slight_smile: I’d rather say that 2.0 GC is “copy
on write friendly” by reducing the amount of memory written during GC
runs.

Links:

http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0

Thanks for those links (especially the first one), Robert!

Kind regards

robert


#5

On 19/03/2013, at 4:43 AM, Ken P. removed_email_address@domain.invalid wrote:

Hi,

If a process is forked on Linux, which version of ruby is implemented
with the copy-on-write technique?

2.0
1.8.6 REE
1.8.7 REE

Henry