3 ms·
> And since there are all kinds of pointers in D, one no longer can use a moving GC allocator, because it cannot know exactly where 100% of the GC pointers are.
by rtfeldman 4y ago
> And since there are all kinds of pointers in D, one no longer can use a moving GC allocator, because it cannot know exactly where 100% of the GC pointers are.
I was astonished to learn that researchers found a way to implement a compacting malloc (!!!) by using very clever virtual memory tricks - and which they were able to use to demonstrate memory usage improvements in a long-running Redis instance that used their drop-in malloc replacement:
https://www.youtube.com/watch?v=xb0mVfnvkp0 https://www.youtube.com/watch?v=xb0mVfnvkp0
- zozbot234 4y agoThat's just trading a fragmented heap for fragmented page tables, though. Modern OS's even support "huge" pages to specifically avoid that page table overhead.
- chrisseaton 4y agoWhy do you say ‘just’? It’s an effective technique.
- _rlh 4y agoStill one of the best ideas in the field in recent years. I will note that it also works for non-moving GC collectors and if they are precise, like Go, they can also update pointers and eliminate the redundant page table entries.