uClinux 363
Memory Fragmentation
The amount of free memory available does not guarantee the same amount
of allocatable memory. For example, if a system has 100 K free memory, it
does not necessarily mean that a
malloc(100K) will be successful. This arises
due to a problem called memory fragmentation. The available memory may
not be contiguous and hence the allocation request cannot be met. The systems
allocation process begins only at a page boundary. A free page is requested
from the available free list and added to the used list. Any subsequent memory
request that fits inside the remaining space is given away from the same page.
And once a page is marked as used it can be returned to the system free list
only when all allocations using the page have ...