# Accumulated memory usage in optimize() Optim package

**URL:** https://discourse.julialang.org/t/accumulated-memory-usage-in-optimize-optim-package/5706
**Category:** General Usage
**Tags:** package, optim
**Created:** [September 3, 2017, 9:49pm UTC](https://discourse.julialang.org/t/accumulated-memory-usage-in-optimize-optim-package/5706 "2017-09-03T21:49:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![WenlongGong](https://avatars.discourse-cdn.com/v4/letter/w/3d9bf3/32.png) [@WenlongGong](https://discourse.julialang.org/u/WenlongGong)
#### Post date: [September 3, 2017, 9:49pm UTC](https://discourse.julialang.org/t/accumulated-memory-usage-in-optimize-optim-package/5706/1 "2017-09-03T21:49:09Z")

</div>

I use the optimize() function with default method like below, to estimate some parameters.

`optimize(nloglikT,g_tol = 1e-8, init, iterations=500, store_trace=true, show_trace=true, show_every=1)`

It consumed accumulating memory as iteration goes up and memory eaten up quickly before it converges. I’m trying to figure out where the problem is. Is there any obvious mistake I’ve made?  
Any comments and discussion would be appreciated!

---

<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: [June 21, 2018, 9:06pm UTC](https://discourse.julialang.org/t/accumulated-memory-usage-in-optimize-optim-package/5706/2 "2018-06-21T21:06:43Z")

</div>

I have a [similar question](https://discourse.julialang.org/t/optim-optimize-uses-excessive-memory-with-autodiff/11872) that I’ve posted under a different topic in hopes that it will be seen.
