Virtual Memory in Operating System
Virtual Memory is a space where large programs can store themselves in form of pages while their execution and only the required pages or portions of processes are loaded into the main memory. This technique is useful as large virtual memory is provided for user programs when a very small physical memory is there.
In real scenarios, most processes never need all their pages at once, for following reasons :
1. Error handling code is not needed unless that specific error occurs, some of which are quite rare.
2. Arrays are often over-sized for worst-case scenarios, and only a small fraction of the arrays are actually used in practice.
3. Certain features of certain programs are rarely used.
Advantages of Virtual Memory
-> The degree of Multiprogramming will be increased.
-> User can run large application with less real RAM.
-> There is no need to buy more memory RAMs.
Disadvantages of Virtual Memory
-> The system becomes slower since swapping takes time.
-> It takes more time in switching between applications.
-> The user will have the lesser hard disk space for its use.
Virtual Memory is a space where large programs can store themselves in form of pages while their execution and only the required pages or portions of processes are loaded into the main memory. This technique is useful as large virtual memory is provided for user programs when a very small physical memory is there.
In real scenarios, most processes never need all their pages at once, for following reasons :
1. Error handling code is not needed unless that specific error occurs, some of which are quite rare.
2. Arrays are often over-sized for worst-case scenarios, and only a small fraction of the arrays are actually used in practice.
3. Certain features of certain programs are rarely used.
Advantages of Virtual Memory
-> The degree of Multiprogramming will be increased.
-> User can run large application with less real RAM.
-> There is no need to buy more memory RAMs.
Disadvantages of Virtual Memory
-> The system becomes slower since swapping takes time.
-> It takes more time in switching between applications.
-> The user will have the lesser hard disk space for its use.