See https://github.com/timholy/ProfileView.jl, or just inspect 
Profile.print(C=true) for calls to the garbage collector. This isn't perfect---
you're wondering about allocation, and this is gc---but since running gc is 
triggered by allocation, this can at least point you in the right direction.

A much more likely candidate for your underlying problem is a type-problem. 
code_typed or TypeCheck.jl may help you find it.

--Tim

On Friday, March 14, 2014 08:30:12 PM andrew cooke wrote:
> What would be nice is something that prints current heap size (without
> consuming any heap itself) that I could sprinkle through the code, so that
> I could see which statement allocates memory.
> 
> On Friday, 14 March 2014 23:49:53 UTC-3, andrew cooke wrote:
> > Any tips / pointers / docs on how to do this?
> > 
> > I have some code that, according to @time, is using more memory than I
> > expect.  How do I work out where the problem is, and reduce the memory
> > use?
> > 
> > Is there anything more efficient than writing small tests that focus on
> > particular operations?
> > 
> > I suspect my problem is that instances are being created on the heap when
> > I expected them to be on the stack (the main data type hasa single field,
> > which is an integer).
> > 
> > Thanks,
> > Andrew

Reply via email to