To rise above from difficulties with fixed partitioning, partitioning can be done dynamically, which called dynamic partitioning. Having it, the primary memory portion for user applications is firstly a single contiguous block. When a new process is made, the precise amount of memory space is allocated to the process. Similarly when enough space is not available, a process can be swapped out temporarily to release space for a new process. The way of the dynamic partitioning working is illustrated in Figure 5.
The effect of dynamic partitioning:
As time passed, there will appear various small holes in the primary memory, which is referred to six as external ragmentation. Therefore although much space is yet available, it can't be allocated to new processes. A technique for overcoming from external fragmentation is compaction. Occasionally the operating system moves the processes so that they can occupy contiguous sections and all of the small holes are brought together to built a big block of space. The disadvantage of compaction is: The process is time-consuming and need relocation capability.