-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in solving ODE many times #1946
Comments
Does it go away if you add an explicit GC call in the loop? |
Yes, it seems to go away with an explicit call in the loop. If I interrupt the loop though and then do a |
It sounds like a behavior of the GC then that should be reported upstream? There's nothing really special that we're doing here, no manual mallocs and alllocs or anything calling C, so there's nothing we'd do in this codebase to change this behavior. It would be good for some base dev to look at though. |
Do you have any news on this problem ? I'm actually facing exactly the same issue. |
This doesn't reproduce for me. What Julia version and OS are you on? also, what's the output of |
It's not exactly the same problem (maybe it's not the good place to put the issue) but i have the same behaviour mentionned above : "Yes, it seems to go away with an explicit call in the loop. If I interrupt the loop though and then do a GC.gc() outside of the loop, the previously allocated memory does not go away.". The code i'm using is the following :
But when i'm running the code i have a slowly increasing memory allocation as you can see on the picture below but as i'm using this function a lot of time in different processes it takes a lot of ram at the end. I'm on ubuntu with julia 1.10.0 and the output of ]st is :
Here i'm using DifferentialEquations.jl and not OrdinaryDiffEq.jl directly and i have seen that the DifferentialEquations.jl latest version is using the version "6.53" OrdinaryDiffEq.jl which is an old one so maybe it's my problem. PS : When i wrote the issue and tried to have a simple example, I also tried to remove StaticArrays in the function simplified_asm1! and the problem disapear (as shown below) so i think there is a problem using StaticArrays when solving many ODEs. |
Does the problem exist when removing Distributed? |
And is this actually an OrdinaryDiffEq thing or a Julia Distributed thing? Is there no way to recreate this without the ODE solver? Again, we do not do any manual memory operations in the ODE solver, so it would be really weird for this to be an ODE solver issue. Almost certainly this is something about Base Julia, in which case this would be the wrong people to report it to and we would likely not be the ones to solve it. |
That's still not very high memory usage. Did you set a GC cap (or whatever it's called) at like 1GB to see if that triggers? I forget the default setting but it may just not be triggering at this level if your computer has enough memory. |
Yeah i have tried to use "--heap-size-hint" keyword when starting the process but it didn't work. Something very weird is that calling GC.gc() outside the function M_t but inside the loop doesn't work whereas calling GC.gc() inside the function M_t works but the program become very slow. It's not high memory usage but when calling the function a lot of time in different processes, at the end i have 400GiB of RAM. |
This probably needs @gbaraldi |
ah, this was fixed half a year ago (#2148), but that doesn't help you if you haven't updated your packages in half a year. |
Ok it's what i have tried to explain at the end of my second message. Just one last question, why DifferentialEquations.jl is using an old version of OrdinaryDiffEq.jl as dependency ? |
it isn't. Something else is pinning your entire dependency stack back by ~6 months. What happens if you |
Ok i'm sorry for the misunderstanding. I didn't understand the "[compat]" section in the Project.toml file. Thanks for the fast resolution of my problem ! |
The following code has monotically increasing memory usage for me and will just keep on growing until the system runs out of RAM and crashes:
This seems to happen whether or not
H
is passed as a parameter or is a captured variable in∂ₜ
.Here's my system:
The text was updated successfully, but these errors were encountered: