CREATE OWN LIBRARY

Fixed partition Memory Allocation

 

The simplest scheme for managing this available memory for user programs is to partition it into regions with fixed boundaries.

 

One possibility of fixed size is to make use of equal partitions or random size of different memory partitions. In this case, any process whose size is less than or equal to the partition size can be loaded into any available memory partition.

 

 

Example: We have 4 processes P1, P2, P3, and P4 with sizes 2MB, 3MB, 6MB, and 1MB correspondingly.   

 

P1           P2         P3          P4

1MB       3MB    6MB      10MB

 

 

There are some disadvantages of Fixed Partition Memory Allocation:   

1. Internal Fragmentation: In the case of main memory utilization for fixed partition is extremely inefficient. Any program, no matter how small, occupies an entire partition. In our example, we have a process P3 with size 6 MB and it is allocated at the free location of 8MB size of memory (As per Best Fit). But after allocating P1, 2MB is still free in this location and it is a wastage of memory, it is called internal fragmentation. No one can access this memory and totally wastage of memory.

 

2. External Fragmentation:  As per the above example, we can see it leads to a situation in which there are a lot of small holes appear in the main memory after allocating all the processes. As time goes on, the memory becomes more and more fragmented, and memory utilization declines.

 

3. Limitation on process size: Because it is a fixed partition, each memory size is fixed, and maybe it is not possible that all processes sizes will fit the available memory. As per the above example let whole memory is free and one process with size 15MB is trying to run, and it is not possible because the maximum memory location size is 10MB. Though the whole memory is available we can’t allocate a process because of process size not fit as per the available memory location size. 

 

Fixed partition is the oldest method and nowadays this technique is never used.

 

# In fixed partitioning external fragmentation solved by the overlay.

 

# In fixed partition when external fragmentation occurs i.e. the process is unable to fit at the memory because process size is bigger than available memory, in that case, the concept of overlays comes into the picture that if we did not run our process due to shortage of memory, we run our process part by part as available memory and this is done by the user (developer) not done by the operating system, this concept is called overlays

 

Fixed Partition: Question GATE

 

Q. Gate 1998

The overlay tree for a program is as shown below:

What will be the size of the partition (in physical memory) required to load (and run) this program?

 

 

a)  12 KB                     b) 14 KB                      c) 10 KB                       d) 8 KB

 

Answer:

 

The process can run anyone path at a time R → A → D or R → A → E or R → B → F or R → C → G.

 

Now,

                                    R→A→D = 2+4+6 = 12 KB 

                                    R→A→E = 2+4+8 = 14 KB 

                                    R→B→F = 2+6+2 = 10 KB 

                                    R→C→G= 2+8+4 = 14 KB

 

So, the minimum partition required to load the program is 14 KB.

 

So, option b is correct.