# JuMP, excessive memory usage?

**URL:** <https://discourse.julialang.org/t/jump-excessive-memory-usage/1057>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [December 20, 2016, 10:38am UTC](https://discourse.julialang.org/t/jump-excessive-memory-usage/1057 "2016-12-20T10:38:50Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![tyleransom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tyleransom/32/530_2.png) [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Post date:** [March 6, 2017, 9:41pm UTC](https://discourse.julialang.org/t/jump-excessive-memory-usage/1057/15 "2017-03-06T21:41:08Z")

</div>

For posterity’s sake, I profiled memory allocation throughout my JuMP call. Here is the [corresponding gist](https://gist.github.com/tyleransom/8eeb2ebf6657d407cb537877d0169109).

Summary of findings:

- [Data generation](https://gist.github.com/tyleransom/8eeb2ebf6657d407cb537877d0169109#file-jumpexampleprofiler-jl-L34) requires 15MB of memory allocation.
- JuMP allocates ~600 MB at the `solve()` [call](https://gist.github.com/tyleransom/8eeb2ebf6657d407cb537877d0169109#file-jumpexampleprofiler-jl-L45)
- Another ~600 MB are allocated at the `MathProgBase.initialize()` [call](https://gist.github.com/tyleransom/8eeb2ebf6657d407cb537877d0169109#file-jumpexampleprofiler-jl-L74).
- These two lines account for almost the entire 1.22GB that are allocated for the entire optimization.
- When breaking down the `MathProgBase.initialize()` [call](https://gist.github.com/tyleransom/8eeb2ebf6657d407cb537877d0169109#file-jumpexampleprofiler-jl-L74), it appears that the second-order derivative computation is what is driving this, as it accounts for 79% of the allocated memory.

As Miles mentioned above, this doesn’t seem to be unintended behavior, but looks more like an issue with the second-order derivatives being too dense. This may also be what is driving @mauro’s problem, too.

---

_[View the full topic](https://discourse.julialang.org/t/jump-excessive-memory-usage/1057)._
