# Tuples with mutable entries?

**URL:** <https://discourse.julialang.org/t/tuples-with-mutable-entries/57734>\
**Category:** New to Julia\
**Created:** [March 22, 2021, 4:25pm UTC](https://discourse.julialang.org/t/tuples-with-mutable-entries/57734 "2021-03-22T16:25:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuliusAurelius](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@JuliusAurelius](https://discourse.julialang.org/u/JuliusAurelius)\
**Post date:** [March 22, 2021, 4:25pm UTC](https://discourse.julialang.org/t/tuples-with-mutable-entries/57734/1 "2021-03-22T16:25:53Z")

</div>

Hey, I just read through this [article](https://jkrumbiegel.com/pages/2020-10-31-tuples-and-vectors/) by Julius Krumbiegel where he explains the differences of Vectors and Tuples and their memory usage. Mainly the advantage of the compiler knowing that the size of the referenced object does not change.

But, because tuples are immutable objects, their “entry content” can not be changed.  
In my current project I have a vector with constant size but changing elements - wouldn’t that also qualify as a stack object? What is the best (hopefully native) type to use in this scenario?  
Currently I am using a vector and the allocated memory is going though the roof…

Thanks!

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 22, 2021, 4:40pm UTC](https://discourse.julialang.org/t/tuples-with-mutable-entries/57734/2 "2021-03-22T16:40:17Z")

</div>

Use StaticArrays, and if they really need to be mutable, use the MArray structure.

> [@JuliusAurelius](#):
>
> Currently I am using a vector and the allocated memory is going though the roof…

Yet this is probably something else. There is no fundamental reason for memory allocation be particularly high when using standard arrays either.

edit2: And welcome!
