Copy-on-write

Hi,

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

On Mon, Mar 18, 2013 at 4:43 PM, Ken P. [email protected] 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

On Mar 18, 2013, at 12:03 PM, Robert K. [email protected]
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

On Mon, Mar 18, 2013 at 6:13 PM, Robert Jackson
[email protected] wrote:

On Mar 18, 2013, at 12:03 PM, Robert K. [email protected] 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

On 19/03/2013, at 4:43 AM, Ken P. [email protected] 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