What is Virtual Memory ?


  • 1
    R

    Virtual Memory is a way of using hard drive to provide a memory for the computer . Elements of virtual memory are called pages. When a needed memory that is not in the real memory is requested a memory from virtual memory moves to real memory address. Computers have a finite amount of RAM so when many programs run at the same time memory can run out. Using virtual memory it can load larger programs at the same time and operate like it has infinite memory. However , using virtual memory can slow computers down because data must be mapped between real memory (physical ) and virtual memory which requires extra capabilities for address translations .


  • 0
    Z

    @ramint said in What is Virtual Memory ?:

    Virtual Memory is a way of using hard drive to provide a memory for the computer . Elements of virtual memory are called pages. When a needed memory that is not in the real memory is requested a memory from virtual memory moves to real memory address. Computers have a finite amount of RAM so when many programs run at the same time memory can run out. Using virtual memory it can load larger programs at the same time and operate like it has infinite memory. However , using virtual memory can slow computers down because data must be mapped between real memory (physical ) and virtual memory which requires extra capabilities for address translations .

    What you have described is mostly related to swapping? Virtual memory just provides a logical address space which does not have 1:1 mapping with physical memory. The mapping between virtual memory to physical memory is done through a few levels of page tables. This essentially means that the contiguous address space of an application (which comes from virtual memory ) does not have to be contiguous in physical memory. Different non-contiguous fragments of physical memory can be mapped to a contiguos virtual memory segment.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.