# Avoiding allocations in \`view\`s

**URL:** <https://discourse.julialang.org/t/avoiding-allocations-in-view-s/25983>\
**Category:** General Usage\
**Created:** [July 3, 2019, 1:05pm UTC](https://discourse.julialang.org/t/avoiding-allocations-in-view-s/25983 "2019-07-03T13:05:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [July 3, 2019, 1:38pm UTC](https://discourse.julialang.org/t/avoiding-allocations-in-view-s/25983/2 "2019-07-03T13:38:10Z")

</div>

One option is UnsafeArrays; see e.g. this post: [Array views becoming dominant source of memory allocation - #32 by oschulz](https://discourse.julialang.org/t/array-views-becoming-dominant-source-of-memory-allocation/6465/32). The current rule of thumb is that creating an array view will allocate if the view is used as an argument to a non-inlined function or if it is returned from a function.

---

_[View the full topic](https://discourse.julialang.org/t/avoiding-allocations-in-view-s/25983)._
