Peformance up - using OobGC & GC.disable

Eric Wong normalperson at
Mon Oct 10 17:53:24 EDT 2011

Tatsuya Ono <ononoma at> wrote:
> I don't actually understand is why GC.disable solution could introduce
> more memory leak. If I simplify the problem, the code is something
> like bellow:
> ---------------
> GC.disable
> (do something)
> GC.enable
> GC.start
> ---------------
> When the code block finishes, I expect that memory size should be
> (almost) equal with the case GC is enabled at begging. But it doesn't
> seems so from our experience.
> Do anyone know why there could be significant difference on memory
> usage because of timing of GC? It might be a question on Ruby rather
> than Unicorn, though, I thought even just sharing my experience could
> be worth to someone here.

Basically, the free(3) function in the C standard library does not
guarantee memory is released back to the kernel (speed vs memory usage

There was discussion of this on the usp.ruby mailing list starting at
Message-ID: 20110914234917.GA2480 at

usp.ruby archives are at

More information about the mongrel-unicorn mailing list