# Preallocating Array in a Memory Efficient Way

**URL:** <https://discourse.julialang.org/t/preallocating-array-in-a-memory-efficient-way/32206>\
**Category:** New to Julia\
**Tags:** array, memory, memory-allocation\
**Created:** [December 12, 2019, 9:57pm UTC](https://discourse.julialang.org/t/preallocating-array-in-a-memory-efficient-way/32206 "2019-12-12T21:57:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [December 13, 2019, 2:08pm UTC](https://discourse.julialang.org/t/preallocating-array-in-a-memory-efficient-way/32206/3 "2019-12-13T14:08:57Z")

</div>

K is around 15! Yes, most elements will be 0. However, most of this are 3-dimensional arrays and I could not get sparse structures to work in this case. A MWE of my problem can be found here [Performance Tips for Combinatorial Problem](https://discourse.julialang.org/t/performance-tips-for-combinatorial-problem/32208)

---

_[View the full topic](https://discourse.julialang.org/t/preallocating-array-in-a-memory-efficient-way/32206)._
