From: MenTaLguY Date: 2007-10-12T03:58:35+09:00 Subject: Re: Should *most* memory be release back to the system? On Fri, 12 Oct 2007 03:25:52 +0900, Sylvain Joyeux wrote: >> Ruby does make a reasonable effort to return unused blocks ("heaps" in >> the parlance of gc.c) to the OS[3], when it is possible to do so. But >> it is not always possible to do so. > Ruby does not free heaps. It it supposed to do so, but the way it > allocates very big heaps forbids him to do that in practice. That's true; Ruby tends to use relatively large heap sizes, which makes it unlikely for there to be any unused heaps which can be freed. Using per-heap freelists and preferring newer heaps for allocation would help, although it would mean additional overhead to determine which heap a freed object belonged to. -mental