# Memory usage in JuMP model

**URL:** <https://discourse.julialang.org/t/memory-usage-in-jump-model/15475>\
**Category:** Optimization (Mathematical)\
**Created:** [September 25, 2018, 3:34pm UTC](https://discourse.julialang.org/t/memory-usage-in-jump-model/15475 "2018-09-25T15:34:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reza](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Reza](https://discourse.julialang.org/u/Reza)\
**Post date:** [September 25, 2018, 3:34pm UTC](https://discourse.julialang.org/t/memory-usage-in-jump-model/15475/1 "2018-09-25T15:34:37Z")

</div>

Hi

I am using JuMP model calling CPLEX 12.6 solver for my problem. My problem is like that I am running a loop and at each iteration, I am solving a convex optimization problem by calling CPLEX in JuMP. At each iteration I am making new JuMP object.  
However, after 80 iterations, I face error 1001:out of memory. It seems memory usage is increased at each iteration of my solution and I need to kind of close or clean the JuMP object at each iteration after solving and saving results. Can you help me how can I clean or close my model at each iteration using ways in JuMP like other programs as **Model.end** or **Model.clean**?  
Thanks.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [September 27, 2018, 2:54am UTC](https://discourse.julialang.org/t/memory-usage-in-jump-model/15475/2 "2018-09-27T02:54:52Z")

</div>

x-ref [https://github.com/JuliaOpt/CPLEX.jl/issues/185](https://github.com/JuliaOpt/CPLEX.jl/issues/185)

Can you follow the advice [here](https://github.com/JuliaOpt/CPLEX.jl/issues/185#issuecomment-424399487) and provide a minimum working example of your code that demonstrates the problem?
