Bráulio Bhavamitra <brau...@eita.org.br> wrote:
> That's the ruby design, as the heap only grows, so with a request that
> loads a lot of data the heap will grow big and never shrink.
> http://izumi.plan99.net/blog/index.php/2007/10/12/how-the-ruby-heap-is-implemented/

That's ancient, I was waiting for Hongli to reply...

> Ruby 2.1 changes that? We will soon migrate to ruby 2.1, but we are
> not ready for it yet.

Yes, Ruby freed object slots since the 1.9 days, I think.

Anyways, I've maintained a bunch of Ruby apps and I've gotten _all_ of
them have stable memory usage.  Often I needed to fix bugs in Ruby
itself or other gems/libraries to get there, though!

One basic rule (which I learned as a Perl hacker): do not slurp.  Limit
the size of data you work with and break things into smaller chunks if
necessary (e.g. data from client uploads or database/API responses).
Things like running a "SELECT" without "LIMIT" in SQL should raise red
flags immediately.
__
http://bogomips.org/unicorn-public/ - unicorn-pub...@bogomips.org
please quote as little as necessary when replying

Reply via email to