You are on page 1of 2

Memory Partitioning: Fixed Partitioning

1. In this scheme memory is divided into a number of fixed sized partition.


2. Each partition can contain exactly one process.
3. The number of partitions and its size are pre-defined. The partitions can be of equal
or unequal size.
4. Always a selected process from the input queue is placed into the free partition.
5. When the executing process finishes the execution and terminates, the partition
becomes free for another process.
6. The operating system maintains a table to keep track on free and occupied partitions
by processes.
7. Equal Size Partitioning:
i. In this scheme memory is divided into a number of fixed sized partition of
equal size.
ii. The degree of internal fragmentation is higher as compared to unequal sized
partitioning method.
iii. Since the size of each partition is equal so, as long as there is any available
partition, a process can be loaded into that partition.
8. Unequal Size Partitioning:
i. In this scheme memory is divided into a number of fixed sized partition of
unequal size.
ii. Allocation of new process into a partition can be done efficiently by best fit
algorithm in following two methods:
a. Method 1:
i. In this method each process is assigned to the smallest partition
big enough to accommodate the process.
ii. In this case, a scheduling queue is needed for each partition to
hold processes destined for that partition.
iii. The advantage of this approach is that processes are always
assigned in such a way as to minimize wasted memory within a
partition (internal fragmentation).
iv. This allocation method may reduce the performance, as processes
queue up for particular partition even though other partition are
empty.
b. Method 2:
i. In this method, a single queue is maintained for all processes.
When it is time to load a process into main memory, the smallest
available partition that will hold the process is selected.
9. Disadvantages:
i. Suffers from internal fragmentation, in which if the size of the partition is
larger than the program size, some space of the partition will be unused
within that partition.
ii. If new process size is larger than the maximum size of partition, then the
process will never be stored in partition.
iii. The number of partitions specified at system generation time limits the
number of active (not suspended) processes in the system.

Memory Partitioning: Dynamic Partitioning


1. In this technique basically a variable partitioning with a variable number of partitions
determined dynamically (based on the processes present in the main memory).
2. Initially, all memory (except the part occupied by OS) is available for user processes,
and is considered as one large block, of available memory, a hole.
3. This technique ensures the efficient use of main memory. There is no internal
fragmentation.
4. Consider the following sequence of process arrival in a main memory of size 60 MB
out of which 10 MB is occupied by the OS:
i. Processes P1 of size 10 MB, P2 of size 25 MB, P3 of size 5 MB, and P4 of size
10 MB arrive in sequence mentioned.
ii. Process P1 and P3 completes their execution and are freed from the main
memory. This leads to creation of 2 holes of size 10 Mb and 5 MB.
iii. Now if a process P5 of size 13 MB arrives will not get loaded in the main
memory, even though the total free space available in memory is 15 MB.
5. As seen above, these holes cannot be allocated to the process of larger size than
these holes (although total available free memory is greater or equal to the new
process). This is called external fragmentation (i.e., the memory that is external to all
partitions becomes increasingly fragmented and is wasted).
6. Any memory allocation algorithm such as first fit, best fit, worst fit, etc., can be used
depending upon the requirement.
7. The problem of external fragmentation can be solved by compaction.

You might also like