0% found this document useful (0 votes)
11 views3 pages

Experiment 8 OS

Uploaded by

awesoham27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Experiment 8 OS

Uploaded by

awesoham27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Exp.

8 - Part A
Aim:
Conduct a study for Process Allocation Algorithms and perform following tasks

1) Implementation of Best Fit Algorithm using programming language


Requirements: C Programming knowledge and understanding of Memory Placement Technique
concept.
Outcome: Understand the Placement Technique algorithm in an operating system..
Theory:
The best fit deals with allocating the smallest free partition which meets the requirement of the
requesting process. This algorithm first searches the entire list of free partitions and considers the
smallest hole that is adequate. It then tries to find a hole which is close to actual process size
needed.
Best fit: The allocator places a process in the smallest block of unallocated memory in which it
will fit. For example, suppose a process requests 12KB of memory and the memory manager
currently has a list of unallocated blocks of 6KB, 14KB, 19KB, 11KB, and 13KB blocks. The best-
fit strategy will allocate 12KB of the 13KB block to the process.

Instructions:
1. Take input queue of memory request and then draw memory consumption based on the
concept of placement technique.
Exp.8- Part B
Name of Student: SOHAM HANDE Roll No.: A129
Programme: BTECH AIDS
Output:
Observation & Learning:
Conclusion:

1. Write all the advantages and disadvantages of Best Fit Placement Technique?

Advantages of Best Fit Placement Technique:

1. Minimizes Fragmentation:
- Best Fit attempts to allocate the process to the smallest available block that fits, which
can help reduce **external fragmentation** compared to other techniques (e.g., First Fit).
- Since the process is allocated the smallest suitable block, it leaves larger chunks of free
memory for other processes.

2. Efficient Space Utilization:


- By fitting processes into smaller memory blocks, the technique aims to maximize
memory usage efficiency and reduce wasted space.

3. More Memory Available for Larger Processes:


- By using the smallest suitable block for each allocation, larger memory blocks are
preserved for processes that require more memory, reducing the risk of large processes
being denied memory due to fragmented smaller blocks.

4. Better for Systems with Limited Memory:


- Systems with limited memory may benefit from the more precise allocation of Best Fit,
as it can handle many small allocations without wasting too much memory in larger free
blocks.

Disadvantages of Best Fit Placement Technique:

1. Slow Allocation Process:


- The Best Fit technique requires a search through the entire list of free memory blocks to
find the smallest block that fits the request. This can be time-consuming and increases
allocation time compared to simpler methods like First Fit or Next Fit.
2. Increased External Fragmentation Over Time:
- Despite its intention to minimize fragmentation, Best Fit can actually **increase
external fragmentation** in the long run because it leaves many small, unusable holes in
memory that are too small to satisfy future allocation requests.

3. Overhead of Frequent Searches:


- The need to continually search for the "best" fit can add significant overhead, especially
as the number of free memory blocks grows, making this approach less scalable.

4. Difficulty with Larger Allocations:


- Best Fit may leave large memory blocks unused, which could prevent future large
processes from getting enough contiguous memory.

5. Compaction May Be Needed:


- Over time, the fragmentation caused by Best Fit may require **memory compaction**
(reorganizing memory) to consolidate small free blocks into larger contiguous spaces,
which adds complexity and overhead.

6. May Not Always be Optimal in Practice:


- While theoretically it may seem efficient, Best Fit can sometimes result in less efficient
allocations compared to First Fit or Next Fit in real-world scenarios, depending on the
pattern of memory requests.

You might also like