For both fixed and dynamic memory allocation schemes, the operating system must keep list of each memory location noting which are free and which are busy. Then as new jobs come into the system, the free partitions must be allocated.
These partitions may be allocated by 4 ways:
1. First-Fit Memory Allocation 2. Best-Fit Memory Allocation 3. Worst-Fit Memory Allocation 4. Next-Fit Memory Allocation
These are Contiguous memory allocation techniques.
Worst-Fit Memory Allocation :
In this allocation technique the process traverse the whole memory and always search for largest hole/partition, and then the process is placed in that hole/partition.It is a slow process because it has to traverse the entire memory to search largest bole.
Here is an example to understand Worst Fit-Allocation –
Here Process P1=30K is allocated with the Worst Fit-Allocation technique, so it traverse the entire memory and selects memory size 400K which is the largest and hence there is an internal fragmentation of 370K which is very large and so many other processes can also utilize this left over space.
Advantages of Worst-Fit Allocation :
Since this process chooses the largest hole/partition, therefore there will be large internal fragmentation. Now, this internal fragmentation will be quite big so that other small processes can also be placed in that left over partition.
Disadvantages of Worst-Fit Allocation :
It is a slow process because it traverse all the partitions in the memory and then selects the largest partition among all the partitions, which is a time consuming process.
- First-Fit Allocation in Operating Systems
- Best-Fit Allocation in Operating System
- Operating Systems | Input Output Systems | Question 5
- Allocation of frames in Operating System
- Non-Contiguous Allocation in Operating System
- Resource Allocation Graph (RAG) in Operating System
- Different Operating Systems
- Operating Systems | Set 4
- Operating Systems | Set 3
- Operating Systems | Set 2
- Operating Systems | Set 9
- Operating Systems | Set 11
- Operating Systems | Set 15
- Operating Systems | Set 16
- Operating Systems | Set 12
- Operating Systems | Set 13
- Operating Systems | Set 14
- Operating Systems | Set 8
- Operating Systems | Set 7
- Operating Systems | Set 1
Improved By : aman singh 34