Memory Partitioning

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

MEMORY PARTITIONING

Memory Partitioning:

1. Fixed Partitioning:
Main memory is divided into a no. of static partitions at system generation time. A process may be
loaded into a partition of equal or greater size.
Memory Manager will allocate a region to a process that best fits it

Unused memory within an allocated partition called internal fragmentation

Advantages:
Simple to implement
Little OS overhead

Disadvantages:
Inefficient use of Memory due to internal fragmentation. Main memory utilization is extremely
inefficient. Any program, no matter how small, occupies an entire partition. This phenomenon, in
which there is wasted space internal to a partition due to the fact that the block of data loaded is smaller
than the partition, is referred to as internal fragmentation.
Two possibilities:
a). Equal size partitioning
b). Unequal size Partition
Not suitable for systems in which process memory requirements not known ahead of time; i.e.
timesharing systems.

(a) Fixed memory partitions with separate input queues for each partition.
(b) Fixed memory partitions with a single input queue.
When the queue for a large partition is empty but the queue for a small partition is full, as is the case
for partitions 1 and 3. Here small jobs have to wait to get into memory, even though plenty of memory
is free

An alternative organization is to maintain a single queue as in Fig. 4-2(b). Whenever a partition


becomes free, the job closest to the front of the queue that fits in it could be loaded into the empty
partition and run.

2.Dynamic/Variable Partitioning:
To overcome some of the difficulties with fixed partitioning, an approach known as dynamic
partitioning was developed . The partitions are of variable length and number. When a process is
brought into main memory, it is allocated exactly as much memory as it requires and no more. An
example, using 64 Mbytes of main memory, is shown in Figure

Eventually it leads to a situation in which there are a lot of small holes in memory. As time goes on,
memory
Page:82 Compiled by: daya
becomes more and more fragmented, and memory utilization declines. This phenomenon is referred to
as external fragmentation, indicating that the memory that is external to all partitions becomes
increasingly fragmented.
One technique for overcoming external fragmentation is compaction: From time to time, the operating
system shifts the processes so that they are contiguous and so that all of the free memory is together in
one block. For example, in Figure h, compaction will result in a block of free memory of length 16M.
This may well be sufficient to load in an additional process. The difficulty with compaction is that it is
a time consuming procedure and wasteful of processor time.
Fig.The Effect of dynamic partitioning

Source : http://dayaramb.files.wordpress.com/2012/02/operating-system-pu.pdf

You might also like