Linked List for Dynamic Partitioning
The better and the most popular approach to keep track the free or filled partitions is using Linked List.
In this approach, the Operating system maintains a linked list where each node represents each partition. Every node has three fields.
- First field of the node stores a flag bit which shows whether the partition is a hole or some process is inside.
- Second field stores the starting index of the partition.
- Third filed stores the end index of the partition.
If a partition is freed at some point of time then that partition will be merged with its adjacent free partition without doing any extra effort.
There are some points which need to be focused while using this approach.
- The OS must be very clear about the location of the new node which is to be added in the linked list. However, adding the node according to the increasing order of starting index is suggestible.
- Using a doubly linked list will make some positive effects on the performance due to the fact that a node in the doubly link list can also keep track of its previous node.