I ran julia with --track-allocation=user, and found some large memory allocations that I can’t understand. Can anyone please help explain?
- What is going on with the for statement here:
- function AtomValues(spec::Array{Float64,1}, attr::Attibutes, atom::Function,
- iEnd=attr.len)
227767586 for i=1:iEnd
0 spec[i] = atom(attr, i)
- end
0 nothing
- end
- What is happening with the if statement here? Sys is a “mutable struct”
- function A_SCC_TB(i::Int, sys::Sys)
1821552352 if sys.csign == sys.Cond[i]
- ProcessE(sys, i)
- end
0 nothing
- end
Answer for 2): it was due to type mismatch. sys.csign was declared as ::Int64, and sys.Cond was declared as ::Array{Int64}. The latter needs to be changed to ::Array{Int64,1}, and then the allocation number becomes 0.