previous | start | next

Example

A memory management system is working with a total memory size of 700K and uses contiguous allocation and variable sized partitions so that no internal fragmentation occurs. It currently has three free blocks available. Their sizes are 50K, 155K, and 100K, respectively, and their location in the memory is as below. The order of the free list is just the increasing order of the beginning addresses of the free blocks.

0      --- increasing addresses -->          700K
+-------+-----+------+------+------+------+------+
| used  | 50K | used | 155K | used | 100K | used |
+-------+-----+------+------+------+------+------+
     
Request First-Fit Best-Fit
  50,155,100 50,155,100
90 50,65,100 50,155,10
100 50,65 50,55,10
60 50, 5 wait

At the third request (for 60K), both First Fit and Best Fit has a free list with a total size of 115K, more that enough. However, for Best Fit this 115K is broken (fragmented) into three pieces of size 50K, 55K, and 10K. None of these 3 blocks is big enough for the request. So the request must wait until some process terminates and releases more memory.



previous | start | next