ForwardDiff.jl icon indicating copy to clipboard operation
ForwardDiff.jl copied to clipboard

More memory allocated after update to Julia 1.6.1

Open sebastianpech opened this issue 4 years ago • 0 comments

I'm trying to figure out why a code of mine allocates twice the amount of memory and takes twice as long after updating to 1.6.1 (from 1.5.4). One of the lines thats allocating more memory (according to the profile) is the call to ForwardDiff.hessian!. I haven't managed to reproduce this in an MWE, however, this simple code

using ForwardDiff
using BenchmarkTools
using LinearAlgebra
f(C,ε) = (C*ε)⋅ε
ε = rand(6)
C = rand(6,6)
@btime ForwardDiff.hessian!(out, x->f($C,x), $ε) setup=(out = DiffResults.HessianResult(ε))

also results in more memory being allocated on 1.6.1

----------------
1.5
----------------
  3.191 μs (12 allocations: 8.28 KiB)
----------------
1.6
----------------
  3.973 μs (11 allocations: 13.31 KiB)

Any ideas what could cause that. That difference is not as large as the one I see in the profiler (there it's about 7 times more memory allocation for 1.6) though.

Version: ForwardDiff v0.10.18

sebastianpech avatar May 07 '21 05:05 sebastianpech