On Tue, Mar 25, 2008 at 11:02 AM, Evan Weaver <[EMAIL PROTECTED]> wrote:
> >  My hunch is that rmagick is allocating large amounts of RAM ouside of
> >  Ruby.  It registers its objects with the interpreter, but the RAM
> >  usage in rmagick itself doesn't count against GC_MALLOC_LIMIT because
> >  Ruby didn't allocate it, so doesn't know about it.
>
> It's allocating opaque objects on the Ruby heap but not using Ruby's
> built-in malloc? That seems pretty evil.

Not really.  It's pretty common in extensions.  You alloc your
structures in whatever way is appropriate for the library you are
using, then use Data_Wrap_Struct with a mark and a free function to
hook your stuff into the Ruby garbage collector.

Your objects are thus known to Ruby as Ruby objects, but you have
potentially large chunks of memory that Ruby itself knows nothing
about.


Kirk Haines
_______________________________________________
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to