GC comes from allocation. So your goal is to reduce allocation. In that page 
Milan suggested, it mentions an allocation-tracking tool. That way you can find 
out where the allocations happen.

--Tim

On Saturday, October 04, 2014 11:22:44 AM moritz braun wrote:
> Dear Milan
> 
> Thanks a lot for your suggestion with @code_typed!
> 
> regards
> 
> Moritz
> 
> On Saturday, 4 October 2014 19:48:24 UTC+2, Milan Bouchet-Valat wrote:
> > Le samedi 04 octobre 2014 à 10:14 -0700, moritz braun a écrit :
> > > Hi
> > > I have looked there but
> > > I did not find it very helpful!
> > 
> > Well, could you be more specific? Have you followed all of the advice
> > given there without any results?
> > 
> > Usually, unexpected memory allocation/garbage collection is due to type
> > instability. Without seeing your code, we cannot say much about whether
> > it's the case or not. You can try using @code_typed and check whether
> > all variables have a concrete type, or use TypeCheck.jl. Or search for
> > "code_typed" in the archives for previous discussions of how to use it.
> > 
> > 
> > Regards
> > 
> > > regards
> > > 
> > > 
> > > Moritz
> > > 
> > > On Saturday, 4 October 2014 19:12:17 UTC+2, Milan Bouchet-Valat wrote:
> > >         Le samedi 04 octobre 2014 à 09:14 -0700, moritz braun a
> > >         
> > >         écrit :
> > >         > Dear All
> > >         > 
> > >         > 
> > >         > I am getting an output like this
> > >         > 
> > >         > 
> > >         > elapsed time: 0.021992131 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.021885618 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.069756221 seconds (15705824 bytes allocated,
> > >         
> > >         67.73% gc
> > >         
> > >         > time)
> > >         > elapsed time: 0.022032602 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.021981155 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.070097864 seconds (15705824 bytes allocated,
> > >         
> > >         67.79% gc
> > >         
> > >         > time)
> > >         > elapsed time: 0.02215203 seconds (15705824 bytes allocated)
> > >         > elapsed time: 0.022196102 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.069812577 seconds (15705824 bytes allocated,
> > >         
> > >         67.61% gc
> > >         
> > >         > time)
> > >         > elapsed time: 0.022312715 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.02169858 seconds (15705824 bytes allocated)
> > >         > elapsed time: 0.064558698 seconds (15705824 bytes allocated,
> > >         
> > >         65.64% gc
> > >         
> > >         > time)
> > >         > elapsed time: 0.022568721 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.021803525 seconds (15705824 bytes
> > >         
> > >         allocated)
> > >         
> > >         > elapsed time: 0.064626184 seconds (15705824 bytes allocated,
> > >         
> > >         65.27% gc
> > >         
> > >         > time)
> > >         > 
> > >         > 
> > >         > for some number crunching function that is called repeatedly
> > >         
> > >         with the
> > >         
> > >         > @time macro  prepended to it.
> > >         > Roughly every third call of the function gc  takes place and
> > >         
> > >         the
> > >         
> > >         > average time  to calculate the integral is increased by
> > >         
> > >         about 60%!
> > >         
> > >         > What in you experience are the typical things to avoid
> > >         > if you want to avoid gc?
> > >         
> > >         Have a look here:
> > >         http://docs.julialang.org/en/latest/manual/performance-tips/
> > >         
> > >         
> > >         You'll also find several threads covering this question on the
> > >         mailing
> > >         list.
> > >         
> > >         
> > >         Regards

Reply via email to