Hacker News new | past | comments | ask | show | jobs | submit login

That's a question for the underlying allocator, surely?

(Quite often the answer is "it isn't")




Not 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.


Nah, 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.


So what happens to long running lisp programs? Running out of memory due to fragmentation eventually?


One would expect at least a provision for a stop the world phase. where all mutator threads get to wait for a massive defragmentation.


Not every GC has compaction phase though, but generational ones do by design.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: