Sunday, June 2, 2013

What is Virtual memory and how Virtual memory works?

Virtual memory is a technique that allows the execution of processes that may not be completely in memory. One major advantage of this scheme is that programs can be larger than physical memory.

Further, virtual memory abstracts main memory into an extremely large, uniform array of storage, separating logical memory as viewed by the user from physical memory. This technique frees programmers from the concerns of memory-storage limitations.

Virtual memory also allows processes to easily share files and address spaces, and it provides an efficient mechanism for process creation.

Virtual memory is not easy to implement, however, and may substantially decrease performance if it is used carelessly.

How Virtual Memory is useful?
Click here to know more

The ability to execute a program that is only partially in memory would confer many benefits:

1. A program would no longer be constrained by the amount of physical memory that is available. Users would be able to write programs for an extremely large virtual-address space, simplifying the programming task.

2. Because each user program could take less physical memory, more programs could be run at the same time, with a corresponding increase in CPU utilization and throughput, but with 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 user program would run faster.

Thus, running a program that is not entirely in memory would benefit both the system and the user.

Thus we see that because of Virtual memory your computer feel like is has unlimited RAM space even though it only has 2 GB installed. Because hard disk space is so much cheaper than RAM chips, it also has a nice economic benefit. ­

Implementation of Virtual Memory

Virtual memory is commonly implemented by demand paging. In a demand paging system processes reside on secondary memory (which is usually a disk). When we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory, however, we use a lazy swapper, which never swaps a page into memory unless that page will be needed.

No comments:

Post a Comment