# Why do functions like similar and copy make 2 allocations for large arrays?

**URL:** <https://discourse.julialang.org/t/why-do-functions-like-similar-and-copy-make-2-allocations-for-large-arrays/117217>\
**Category:** New to Julia\
**Created:** [July 19, 2024, 7:19am UTC](https://discourse.julialang.org/t/why-do-functions-like-similar-and-copy-make-2-allocations-for-large-arrays/117217 "2024-07-19T07:19:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/224680_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [July 19, 2024, 7:44am UTC](https://discourse.julialang.org/t/why-do-functions-like-similar-and-copy-make-2-allocations-for-large-arrays/117217/3 "2024-07-19T07:44:33Z")

</div>

Which Julia version are you on? The `Memory` changes of 1.11 are known to cause this behavior

> [@Increase in allocations with Julia v1.11-beta](https://discourse.julialang.org/t/increase-in-allocations-with-julia-v1-11-beta/112838):
>
> Is the number of allocations considered an issue? In my small tests here with my packages I’m not seeing performance regressions, but I systematically see the number of allocations increasing, even when compilation is not involved: 1.10.2: julia\> using CellListMap julia\> x, box = CellListMap.xatomic(10^6); julia\> @btime CellList($x, $box) 244.720 ms (13742 allocations: 139.53 MiB) 1.11: julia\> using CellListMap julia\> x, box = CellListMap.xatomic(10^6); julia\> @btime CellList($x, $box)…

---

_[View the full topic](https://discourse.julialang.org/t/why-do-functions-like-similar-and-copy-make-2-allocations-for-large-arrays/117217)._
