Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some binaries (byte buffers as you called them) are stored outside the process heap, and those are messaged by reference, not by copying; but all other terms are messaged by copying. This is a lot of copying, but it makes the GC very simple, so it's usually a positive tradeoff. Although, there's probably some use cases where it's not great. For those, it might makes sense to force things into the off process heap binaries (RefC), or possibly by doing terrible things with native code (Nifs). You might also put things into the included key-value memory storage (ets), and more selectively pull things out to avoid copying a large chunk data to every process that needs a small piece.


It is possible to create nif objects which are tied into the garbage collector and reference counted, and bound to a destructor function that gets called when the VM is done with it!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: