# Is the garbage collector non-compacting?

**URL:** https://discourse.julialang.org/t/is-the-garbage-collector-non-compacting/16335
**Category:** General Usage
**Created:** [October 15, 2018, 8:26am UTC](https://discourse.julialang.org/t/is-the-garbage-collector-non-compacting/16335 "2018-10-15T08:26:56Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)
#### Post date: [October 15, 2018, 1:43pm UTC](https://discourse.julialang.org/t/is-the-garbage-collector-non-compacting/16335/2 "2018-10-15T13:43:35Z")

</div>

Afaiu, the GC will never ever become compacting, for reasons of C interoparability.

Consider pulling a `deepcopy` of your data. This is, by the way, not just for fragmentation but will also allocate such that any operation that traverses your structure in `deepcopy`-order is more cache-friendly.

---

_[View the full topic](https://discourse.julialang.org/t/is-the-garbage-collector-non-compacting/16335)._
