Hello,
I have a system in which I need to repeatedly solve an electrostatics problem with an evolving charge configuration. When I left my program running overnight, I came back to find that RAM utilization had accumulated to around 30GB and the program had slowed to a crawl. I believe I’ve located the problem line
ldiv!(solution, stiff_factorization, force_vector)
When I comment this out, the program is able to complete with well under ~1GB of RAM allocation. I’m wondering if I need to manually clean up any memory being used by the solver. I tried to create a small example of what I’m working with, but memory doesn’t seem to accumulate in the same way. I’m not very familiar with the workings of the Garbage Collector, so any advice about how to avoid a memory leak over longer runs is appreciated. Thank you!
using JLD2
using LinearAlgebra
stiffness_matrix = load("./dev/ldiv_memory/stiff_mat.jld2", "stiff_mat")
issymmetric(stiffness_matrix)
factorization = cholesky(stiffness_matrix)
dim = size(stiffness_matrix, 1)
sol = zeros(dim)
for i=1:1_000_000
force_vector = rand(dim)
ldiv!(sol, factorization, force_vector)
end