Memory Management Requirements in OS
Memory Management Requirements:
There are 6 methods, policies for Memory Management Requirements:
-
1. Swapping
2. Sharing
3. Relocation
4. Protection
5. Logical Organization
6. Physical Organization
Swapping:
Swapping is a method to improve the main memory utilization. Moving a process from the main memory to the backing store and swapping a process from the backing store to the main memory is called Swapping. Swapping requires a ‘Backing store’. The backing store is commonly a fast disk. It must be large enough to accommodate the copies of all process images for all users. When a process is swapped out, its executable image is copied into a backing store. When it is swapped in, it is copied into the new block allocated by the memory manager.
Sharing:
Generally, protection mechanisms are required at the time of access to the same portion of the main memory by several processes. Accessing the same portion of the main memory by the number of processes is said to be Sharing.
Relocation:
Relocation is a mechanism to convert the logical address into the physical address. It is necessary at the time of swap in a process from one backing store to the main memory.
Protection:
Protection means to provide security from unauthorized usage of memory. The operating system can protect the memory with the help of base and limit registers. Base registers consist of the starting address of the next process. The limit register specifies the boundary of that job, so the limit register is also said to be Fencing Register.
Logical Address:
An address which is generated by the CPU that is called Logical Address.
Physical Address :
An address which is generated by MMU (Memory Management Unit) that is called Physical Address.
Physical Address = Logical Address + Content of the base registers.
1. Logical address is generated by CPU. | 1. Physical address is generated by MMU (Memory Management Unit). |
2. Logical address is also called Virtual address. | 2. Physical address is also called Real address. |
3. The set of all Logical address is referred to as "Logical Address Space". | 3. The set of all Physical address is referred to as "Physical Address Space". |
4.Logical address range from 0 to max. | 4. Physical address range from (R+0) to (R+Max). (where R= Base Relocation Register value) |