# OutOfMemoryError()\_solved by sparse matrix

**URL:** <https://discourse.julialang.org/t/outofmemoryerror-solved-by-sparse-matrix/35955>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 14, 2020, 3:18am UTC](https://discourse.julialang.org/t/outofmemoryerror-solved-by-sparse-matrix/35955 "2020-03-14T03:18:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [March 14, 2020, 6:40am UTC](https://discourse.julialang.org/t/outofmemoryerror-solved-by-sparse-matrix/35955/2 "2020-03-14T06:40:34Z")

</div>

There is not enough given for me to recreate the problem.  
For instance, what happens in `num_origin_1d_fix` is not known. It is always easiest to track down a problem when the context (lines of code) has been stripped down as much as possible, while still triggering the error.

Just guessing, your out of memory error may happen because there is something that could be better structured internally – leaking a great deal of memory inadvertantly is not usually a problem with Julia code; however you may be generating many copies of arrays for which only one or a few are utilized. And it is certainly possible that you have created dependencies among some chain[s] of them that is preventing the Garbage Collector from culling. Alternatively, you may be spawning many more threads than intended or requiring each to have very large local memory. This is all speculation, though.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

_[View the full topic](https://discourse.julialang.org/t/outofmemoryerror-solved-by-sparse-matrix/35955)._
