From: Hongli Lai Date: 2008-03-20T23:45:11+09:00 Subject: Re: Copy-on-write friendly garbage collector Yukihiro Matsumoto wrote: > By the way, I'd like to know how much effective this copy-on-write > friendly patch is. Does anyone have a good (even artificial) case? I use the following test: http://pastebin.com/f353f2ade It loads Ruby on Rails (2.0.2), then runs garbage collection in a child process. The results are as follows: == Standard Ruby: After forking, before gc: - Parent process: 64 KB private dirty memory - Child process 1: 60 KB private dirty memory - Child process 2: 128 KB private dirty memory After forking, after gc: - Parent process: 64 KB private dirty memory - Child process 1: 60 KB private dirty memory - Child process 2: 9.1 MB private dirty memory == My Ruby: After forking, before gc: - Parent process: 64 KB private dirty memory - Child process 1: 60 KB private dirty memory - Child process 2: 156 KB private dirty memory After forking, after gc: - Parent process: 64 KB private dirty memory - Child process 1: 60 KB private dirty memory - Child process 2: 1.1 MB private dirty memory Some parts of the memory are made dirty for as yet unknown reasons. It seems to have something to do with the way the system malloc() is implemented.