From: Daniel DeLorme Date: 2007-08-14T12:14:34+09:00 Subject: Re: Why don't Ruby libraries share memory? Matt Harvey wrote: > Sorry, I started talking about Rails again. The question is not about > Rails. The questions are: Is there any way we can have shared Ruby > libraries without turning the relevant code into a C extension? Is it > necessary that code be compiled to be put into shared memory by the OS? The problem goes further than that. Even if you were to load your libs in one process and then fork off worker processes (using copy-on-write to share loaded code), the gargabe collector writes to *every* page in memory when doing a garbage collecting run, thus negating the benefits of COW. It's fixed in 1.9, thankfully, but 1.8 is going to be a memory hog no matter which way you look at it. Daniel