Since it allocates 120MB on the first call and only 9kB on the second, all that memory is just due to compilation.
The only way I know to fix that is to precompile some of the functions when you build julia. If this is a big deal to you, consider adding your own custom userimg.jl (and see base/precompile.jl for a model). http://docs.julialang.org/en/latest/manual/modules/?highlight=userimg#module-initialization-and-precompilation --Tim On Friday, February 06, 2015 11:23:52 AM Viral Shah wrote: > This is because the internal operations with svds are allocating new > vectors every iteration. This PR should address it, but needs to be > completed, > > https://github.com/JuliaLang/julia/pull/7907 > > Also, array indexing giving views by default will also help here. > > -viral > > On Friday, February 6, 2015 at 7:50:24 PM UTC+5:30, Todd Leo wrote: > > Hi Julians, > > > > I am trying to apply svd on a very large sparse matrix using svds. When > > warming up svds function, I used a very small random vector, and the > > number > > of singular values (nsv) is set to one. However, this simple set up > > results > > in a considerable high cost of time, and as much as 120MB memory is > > occupied. To me, it doesn't make sense, and one can reproduce it by: > > > > julia> @time svds(sprand(3,3,0.1), nsv = 1) > > > >> elapsed time: 2.640233094 seconds (117 MB allocated, 1.06% gc time in 5 > >> > >>> pauses with 0 full sweep) > > > > Regards, > > Todd
