-
Notifications
You must be signed in to change notification settings - Fork 0
Description
About the issues raised in this ticket about fragmentation.
This article has a test for fragmentation:
"Allocations are done via brk() and others via mmap(). Smaller, manageable allocations are done via brk(), while larger ones are handled via an mmap() call. Knowing how this worked, I created a bit of simple C code with a pathological pattern. It would allocate objects in two waves, and then it would delete the earlier allocations while keeping around the ones that came later. This renders the address range where they would be allocated only half-utilized by the process, but still uses the memory of all allocations made thus far.
You can watch this in action with the following code and top (though the behavior may differ slightly depending on your system’s allocator):"
There is another article talking about fragmentation and a link to the reference article about RTOS fragmentation, maybe it will help: