# Estimate memory requirements of ODE solver

**URL:** <https://discourse.julialang.org/t/estimate-memory-requirements-of-ode-solver/104567>\
**Category:** General Usage\
**Tags:** memory, garbage-collection, ordinarydiffeq\
**Created:** [October 4, 2023, 10:25am UTC](https://discourse.julialang.org/t/estimate-memory-requirements-of-ode-solver/104567 "2023-10-04T10:25:54Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [October 6, 2023, 1:03pm UTC](https://discourse.julialang.org/t/estimate-memory-requirements-of-ode-solver/104567/6 "2023-10-06T13:03:19Z")

</div>

As a debug help, i have added the following to a `FunctionCallingCallback`:

```julia
totalmem = printMem((integrator,State,setup,saved_values)) 
@info "Memory usage: " totalmem integrator = printMem(integrator) State = printMem(State) parameters = printMem(parameters) savedvalues = printMem(saved_values) integOverState = Base.summarysize(integrator) / Base.summarysize(State)

```

which should give me an overview of all the allocated objects.

```julia
┌ Info: Memory usage: 
│ totalmem = "4.598 GiB"
│ integrator = "4.598 GiB"
│ State = "65.552 MiB"
│ parameters = "248.153 MiB"
│ savedvalues = "2.312 MiB"
└ integOverState = 71.821170284851291

```

Nearly all of the memory is taken by the integrator, and it is about what it should take, i.e. ~72x.  
So I take that the ODE should fit comfortably in my memory (even if the state is larger, about 600MB for my original problem). Probably my issue is not within `OrdinaryDiffEq` I will investigate whether [its an issue with the GC not being aggressive enough](https://discourse.julialang.org/t/garbage-collection-not-aggressive-enough-on-slurm-cluster/61649/2)

---

_[View the full topic](https://discourse.julialang.org/t/estimate-memory-requirements-of-ode-solver/104567)._
