Os CH 3
Os CH 3
Os CH 3
Memory- Management
Memory is one of the most important resources of the computer that is used to
store data and programs temporarily.
Part of an operating system that manages a memory is called the Memory
Manager (MM).
The main functions of MM are:
Keeping track of which part of memory is in use and which parts are free
Allocating and de-allocating memory to processes.
Managing swapping between memory and disk when memory is not big
enough to hold all the processes.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 1
Swapping
Swapping is a technique of temporarily removing inactive programs from
the memory of the system.
The programs resides in the secondary memory (the disks) must be
brought into main memory from secondary memory because CPU has
direct access to the main memory.
But the size of the main memory is limited.
To maintain the degree of multiprogramming ,a process can be swapped
temporarily out of memory to a backing store, and then brought back into
the memory for continuing execution.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 2
Swapping Con’t…
There are various scenarios where the OS swaps a process from a main
memory to secondary memory. Some of these are:
If a process completes its execution
If a process is waiting for some I/O operations
If a process is trying to access some OS area of some other processes
If a multi-programming environment with a round robin CPU scheduling
is used
If a multi-programming environment with a priority CPU scheduling is
used
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 3
Swapping Con’t…