3 ms·
Are there implementations that actually do this? I would think the page level granularity of virtual memory makes it not that useful for this purpose, since th
by mschwaig 7y ago
Are there implementations that actually do this?
I would think the page level granularity of virtual memory makes it not that useful for this purpose, since the used and unused parts of the two pages would have to line up nicely and larger objects tend to cause less fragmentation.
- chrisseaton 7y agoI first saw this done in 2009 in the Hound memory allocator. I think it's been tried in or implemented in recent Glibc, but wouldn't swear to that. I think it's been shown to be useful in practice in real applications in a couple of papers. Fragmentation is often just one pesky object holding onto a whole page. If you have many such pages all with one object it's likely you can map them all together and release most of them.
- chenglou 7y agoThere are, for example: https://www.youtube.com/watch?v=VMP2w5o4Yco https://www.youtube.com/watch?v=VMP2w5o4Yco Their algorithm also addresses your concern of how to make pages “line up”. This method’s likely subject to the criticisms around this post.