Subject:
Re: [ruby-ffi] Re: freeing memory after FFI::MemoryPointer.new
From:
Chuck Remes
Date:
1/5/11 9:16 AM
To:
ruby-ffi@googlegroups.com


On Jan 5, 2011, at 7:51 AM, Alvaro wrote:

> I understand your point about how it works the garbage collection.
> Is a kind strange that the C lib purely don't have leaks but with the
> FFI binding it has and I couldn't find the reason yet, may be is
> inherited to ruby, I've tested it with Ree, Mri and JRuby without
> success.
> 
> I will continue trying to figure out what is happening, thanks for
> your comments.

Is this code public and available online somewhere? If so, someone on this list may get curious and look at it too.

It's possible, though unlikely, that the leak is in the FFI library. I had some massive leaks in a library I wrote using FFI, but I tracked 100% of them back to my own errors. There are now 0 leaks in the code (though I did find a few minor ones in each Ruby runtime).

cr