From: John Ky Date: 2008-12-02T17:31:21+09:00 Subject: Re: Memory usage with blocks ------=_Part_136048_26489890.1228207016282 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I think it's the memory profiler I'm using: MemoryProfiler.start Nevermind. Does anyone know how to properly find memory leaks in a ruby app? Thanks, -John On Tue, Dec 2, 2008 at 7:19 PM, John Ky wrote: > Hi all, > > I've got some code, which when run uses a lot of memory (aprox 600 MB for a > particular given input). I am trying to figure out why it is using so > much. > > When I replace the following code: > > head.play_back do |root| > block.call(root) > end > > With this: > > head.play_back(&block) > > And make other similar changes. The program behaves exactly the same way, > but now uses 200MB less. Can someone explain to me why this is the case? > > I use blocks everywhere and I'm worried, they're leaking in my code. > > joky@linux08:~/wa/bvc-pure-cs/comet/src/swig_client_api/ruby $ ruby -v > ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux] > > Thanks > > -John > ------=_Part_136048_26489890.1228207016282--