Peformance up - using OobGC & GC.disable

Tatsuya Ono ononoma at gmail.com
Mon Oct 10 13:05:15 EDT 2011


This solution is awesome. I applied the patch on our staging server
and I've confirmed a significant performance improve. Some
pages(especially complicated ones) responds like 4 times faster than
before.

However it seems that we hit a same issue Yuichi had. When we had an
access on particular page, I can see memory size of worker increases
5-10MB...

> Also, my rails application have memory leaks ;(
> I wrote process killing code because GC.disable create more memory leak.
> - https://gist.github.com/1258681

Beside I want to avoid to use this solution if possible...

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.


Tatsuya Ono


More information about the mongrel-unicorn mailing list