On Saturday, January 03, 2015 11:03:06 AM Christoph Ortner wrote:
> I then tried to use the @code_warntype / @code_typewarn macro to see if
> this would detect something, but it seems this macro does not exist in my
> Julia installation? Does this only come with 0.4?
Yes, only julia 0.4.
> As an aside: for the fast version, @time claims only 13888 bytes have been
> allocated, but track-allocation claims that one particular line allocated
> 2480888 bytes???
My guess is you're being fooled by allocation that occurs during compilation.
Try this sequence:
#load your code
using BlahBlah
# Use your code
# Here I'm assuming this initializes the object A and runs mytest(A),
# perhaps among other things
include("runtests.jl")
clear_malloc_data()
mytest(A)
exit()
The clear_malloc_data erases any allocation that occurs previously, so that
when you quit (which triggers the writing of the *.mem files), it only counts
things that occurred when you ran the JIT-compiled `mytest`.
--Tim