Visualizing Memory Allocation Techniques: G Prajesh Kumar (19bce2175) Sundarakannappan K (19bce2302)

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Review1

Visualizing Memory Allocation


Techniques
G Prajesh Kumar (19BCE2175)
SundaraKannappan K (19BCE2302)

1
Abstract :
• Memory management is a important aspect of any operating system.
There are various methods to manage memory in a computer.

• First fit , best fit and worst fit are few memory allocation techniques.

• We are also going to implement compaction for every above


mentioned techniques.

2
Aim:
Visualise and implement the following memory allocation techniques
and its corresponding algorithms :
• First fit
• Best fit
• Worst fit

Assign process/ jobs to the above mentioned techniques and also


visualise and implement compaction for each.

3
Memory Allocation
• Memory allocation is a process by which computer programs
and services/processes are assigned with physical or
virtual memory space.
 
• It is also the process of reserving a partial or complete portion
of computer memory for the execution of programs and
processes. 

4
First Fit
In the first fit approach is to allocate the first free partition or memory large enough which can
accommodate the process. It finishes after finding the first suitable free partition.

Best Fit
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 memory block which is close to actual process
size needed

Worst fit
In worst fit approach is to locate largest available free portion so that the portion left will be big
enough to be useful. It is the reverse of best fit.

5
Compaction
• Compaction is a process in which the free space is collected in a large memory
chunk to make some space available for processes.

•  Compaction helps to solve many problems, but it requires too much of CPU time.

• It moves all the occupied areas of store to one end and leaves one large free space
for incoming jobs, instead of numerous small ones.

•  In compaction, the system also maintains relocation information and it must be
performed on each new allocation of job to the memory or completion of job from
memory.

6
Tech Stack:
Programming language : C/C++

IDE: CodeBlocks

GCC Compiler for C/C++

GitHub (for collaboration)

You might also like