What is Memory Management in Operating System.?
What is Memory Management in the Operating System??
Memory is an important resource that must be carefully managed.
Every programmer would like is an infinitely large, infinitely fast memory that is also non-volatile,
that is, does not lose its contents when the electric power fails.
Most computers have a memory hierarchy, The part of the operating system that manages the
the memory hierarchy is usually called the memory manager.
Its job is to keep track of which parts of memory are in use and which parts are not in use, to
allocate memory to processes when they need it and deallocate it when they are done, and to
manage to swap between main memory and disk when main memory is too small to hold all the
processes.
* Contiguous Memory Allocation :
Memory mapping and protection issue:
The main memory is divided into 2 partitions OS space, and userspace.
The OS space along with the interrupt vector resides in low memory, and the userspace resides
in high memory.
We need to protect the OS space from mistakenly accessed.
We do this by using a relocation register together with the limit register.
The relocation register contains the value of the smallest physical address and the limit register
contains the range of logical addresses.
The value of the logical address must be less than the value in the limit register.
For Example : relocation=100040 and limit=74600. With this, each logical address must be less
than the limit register and the Logical address is mapped with a relocation register. This mapped address
is sent to memory.
* Memory Allocation :
There are 3 different Memory Allocation Schemes:
Fixed-size Partitions: the simplest memory allocation schemes in which the memory is
partitioned into a set of fixed-length partitions and each partition contains only one process.
Multiple-partitions method: When a partition is free, a process is selected from the input
queue and loaded into the free partition, and when the process terminates, the partition
becomes free.
Variable-size partitions: When a Process Arrives and needs memory, the system searches the
set for a block that is large enough for this process.
If the block is large, it is split into two parts.
One part is allocated to the arriving process, the other is returned to the set of blocks. When a
process terminates, it releases its block of memory, which is then placed back in the set of
blocks. There is one problem to select a block to satisfy the request.
There are many solutions
to these problems.
1)First Fit: Allocate first block that is big enough
2)Best Fit: Allocate the smallest block that is big enough
3)Worst Fit: Allocate the largest block
Memory is an important resource that must be carefully managed.
Every programmer would like is an infinitely large, infinitely fast memory that is also non-volatile,
that is, does not lose its contents when the electric power fails.
Most computers have a memory hierarchy, The part of the operating system that manages the
the memory hierarchy is usually called the memory manager.
Its job is to keep track of which parts of memory are in use and which parts are not in use, to
allocate memory to processes when they need it and deallocate it when they are done, and to
manage to swap between main memory and disk when main memory is too small to hold all the
processes.
* Contiguous Memory Allocation :
Memory mapping and protection issue:
The main memory is divided into 2 partitions OS space, and userspace.
The OS space along with the interrupt vector resides in low memory, and the userspace resides
in high memory.
We need to protect the OS space from mistakenly accessed.
We do this by using a relocation register together with the limit register.
The relocation register contains the value of the smallest physical address and the limit register
contains the range of logical addresses.
The value of the logical address must be less than the value in the limit register.
For Example : relocation=100040 and limit=74600. With this, each logical address must be less
than the limit register and the Logical address is mapped with a relocation register. This mapped address
is sent to memory.
* Memory Allocation :
There are 3 different Memory Allocation Schemes:
Fixed-size Partitions: the simplest memory allocation schemes in which the memory is
partitioned into a set of fixed-length partitions and each partition contains only one process.
Multiple-partitions method: When a partition is free, a process is selected from the input
queue and loaded into the free partition, and when the process terminates, the partition
becomes free.
Variable-size partitions: When a Process Arrives and needs memory, the system searches the
set for a block that is large enough for this process.
If the block is large, it is split into two parts.
One part is allocated to the arriving process, the other is returned to the set of blocks. When a
process terminates, it releases its block of memory, which is then placed back in the set of
blocks. There is one problem to select a block to satisfy the request.
There are many solutions
to these problems.
1)First Fit: Allocate first block that is big enough
2)Best Fit: Allocate the smallest block that is big enough
3)Worst Fit: Allocate the largest block



Comments
Post a Comment