Memory leak when migrating from Julia 1.10.7 to 1.11.2

Hi,
I’m encountering a memory issue in Julia v1.11.2 with a Monte Carlo simulation. The code spans multiple files which makes it hard for me to post it here. I can say that the code doesn’t allocate new memory after the Monte Carlo simulation starts (I have checked this on my PC by monitoring the memory usage). On my PC, memory usage is stable, but on a cluster, it grows significantly (after the simulation begins), leading to OOM errors. This didn’t happen in Julia v1.10.7, where I ran the same code for over 20,000 CPU hours without issues (and the memory usage is stable once the simulation begins). What could be causing this memory leak in Julia v1.11.2, and how can I debug it?

2 Likes

Perhaps try taking and comparing heap snapshots.

Sounds like Memory leak with Julia 1.11's GC (discovered in SymbolicRegression.jl) · Issue #56759 · JuliaLang/julia · GitHub which was fixed by gc: improve mallocarrays locality by vtjnash · Pull Request #56801 · JuliaLang/julia · GitHub which is marked for backport.

Can you try nightly?

5 Likes

Thanks for pointing this out. My issue is exactly like the one in Memory leak with Julia 1.11's GC (discovered in SymbolicRegression.jl) · Issue #56759 · JuliaLang/julia · GitHub.

I will try to run a job with the nightly version of Julia and see if that fixes things.

The nightly version fixed the issue. Thanks.

5 Likes