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

OK, I understand. The symptom you're describing isn't really "fragmentation". Fragmentation is the inability to use smaller blocks of memory because the larger allocations won't fit. That behavior isn't changed by this.

You're talking about a resource reclamation issue. Unmapping a page is a clear signal to the kernel that the memory is unused and can be repurposed immediately. Otherwise, it needs to find and eject a page from memory using the VM system, which is more expensive (though I'd guess not a lot more expensive except in pathologically allocation-bound systems).



You are right, it's not fragmentation but resource reclamation. I've added a note to the initial post.

I'm not sure though that the VM system can reclaim memory in the heap allocated with sbrk(). At least I've never seen that before. Or do you mean "eject" as in swap out?




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

Search: