# Possibility of reducing memory usage EnsembleProblem

**URL:** <https://discourse.julialang.org/t/possibility-of-reducing-memory-usage-ensembleproblem/76019>\
**Category:** Modelling & Simulations\
**Tags:** question, diffeq\
**Created:** [February 8, 2022, 1:04pm UTC](https://discourse.julialang.org/t/possibility-of-reducing-memory-usage-ensembleproblem/76019 "2022-02-08T13:04:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brent](https://avatars.discourse-cdn.com/v4/letter/b/ec9cab/32.png) [@Brent](https://discourse.julialang.org/u/Brent)\
**Post date:** [February 8, 2022, 1:04pm UTC](https://discourse.julialang.org/t/possibility-of-reducing-memory-usage-ensembleproblem/76019/1 "2022-02-08T13:04:58Z")

</div>

I was wondering if it is possible to reduce the memory usage of an EnsembleProblem for large numbers of trajectories, for instance by saving to a file between batches. I’m currently running into the issue of being limited by memory in part due to having a large problem, and the possibility to reduce memory usage seems like it would help drastically. The reduction function seems to be related, but I would rather not truncate my data and save it to file instead. If there are other possibilities, I would also love to hear it.

What my solver looks like:  
`@time ensemble_jsol = solve(ensemble_jprob, SSAStepper(), EnsembleSerial(), trajectories=10)`

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 8, 2022, 1:22pm UTC](https://discourse.julialang.org/t/possibility-of-reducing-memory-usage-ensembleproblem/76019/2 "2022-02-08T13:22:06Z")

</div>

> [@Brent](#):
>
> I was wondering if it is possible to reduce the memory usage of an EnsembleProblem for large numbers of trajectories, for instance by saving to a file between batches. I’m currently running into the issue of being limited by memory in part due to having a large problem, and the possibility to reduce memory usage seems like it would help drastically. The reduction function seems to be related, but I would rather not truncate my data and save it to file instead. If there are other possibilities, I would also love to hear it.

That’s exactly what the reduction function is for. Use it to save the batch to a file.
