Are Ruby fork COW friendly, if so, how to test them

I read where this ruby fork is COW . ok here is the link

But then, when I appear with Google for more information about this, I found out that Ruby does not support COW (copy on write)

Now I'm a little confused if ruby ​​support is really or not COW .

I also know that REE and Rubinius have COW friendly GC , so do I do that REE and Rubinius support COW functionality

I, yes, I know how to test it, can anyone tell me that if support ruby COW , how to write a sample for testing COW concept in Ruby

thank

+3
source share
1 answer

forkbeing copy-on-write is a property of the kernel of your operating system, not Ruby. Most UNIX-like systems have one.

On Linux, for example, you can look in /proc/pid/smapsand see how many total heaps are displayed. Here is an example from bashdoing fork:

02020000-023cd000 rw-p 00000000 00:00 0                                  [heap]
Size:               3764 kB
Rss:                3716 kB
Pss:                1282 kB
Shared_Clean:          0 kB
Shared_Dirty:       3652 kB
Private_Clean:         0 kB
Private_Dirty:        64 kB
Referenced:          144 kB
Anonymous:          3716 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB

So out of its 3764k heap, 3652k is common. See proc.txt for file documentation in /proc.

, Ruby -, COW (, , ), , 0.

+1

All Articles