Blogger Tricks

15 May 2012

Virtual Memory Technology

All previous discussed memory management schemes require that whole process to be in memory before process can execute. That’s why need memory management algorithms.

“Virtual Memory” is a technique that allows the execution of processes that may not be completely in memory.

Virtual memory is separation of user logical memory from physical memory. This separation allows that an extremely large virtual memory is to be provided for programmers when only a smaller physical memory is available.

Virtual memory is commonly implemented by “Demand Paging”.

Advantage
1.    programs can be larger the physical memory.
2.    It separates physical memory from logical memory as viewed by user.
3.    It frees programmers from thinking about memory storage limitation.
Note
1.    Virtual memory is not easy to implement.
2.    It can decrease performance if it is not used carefully.

Why Virtual Memory?

Observation 1: examination of real program shows that in many cases the entries program is not needed for example:

1.    A program would often contain some code (routine) which handles unusual error condition. These errors are rarely occurring and sometimes never executed.
2.    Arrays lists and tables are often allocated more memory than the actual requirement. An array of 100 X 100 elements is never utilized fully.
3.    Certain feature of program are used rarely. E>G routine to balance budget in finance system of government have been used in years.

Observation 2: event if entries program is needed, it may not be needed at same time.

Benefits: if we are able to execute a program which is partially available in memory than system and user both get benefits.

1.    A program would not be constrained by amount of available physical memory. User would be able to write programs for extremely large virtual memory.
2.    Each user program takes less physical memory. So more processes could be run at the same time. This will increases CPU utilization and throughput. But there will be no increase in response time or turnaround time.
3.    Less I/O would be needed to load or swap each user program into memory. So each program would run faster.