4 ms·
So how is memory fragmentation avoided?
by andi999 5y ago
So how is memory fragmentation avoided?
- pjc50 5y agoThat's a question for the underlying allocator, surely? (Quite often the answer is "it isn't")
- andi999 5y agoNot just for the allocator. I always thought a main point of a garbage collector was heap compactification (shuffling things around so there is more space), but maybe I am wrong.
- xxs 5y agoNot every GC has compaction phase though, but generational ones do by design.
- cmrdporcupine 5y agoNah, only copying / generational collectors do heap compactification. A simple Mark&Sweep collector doesn't, for example. Nor does reference counting. Both of which are used by many Lisp or Lisp-like languages. Nothing can substitute for a really good allocator.