. Explain the following in regards to virtual memory : a. What is the purpose of
ID: 3548433 • Letter: #
Question
. Explain the following in regards to virtual memory:
a. What is the purpose of virtual memory and where is it physically located?
b. When will a page be loaded into main memory, and what mechanisms are used to load a page into main memory?
c. When will a page be removed from main memory, and what is done with the removed page?
d. Describe 2 ways using virtual memory can be advantageous, even if the total size of virtual memory is equal to (i.e. not larger than) the size of physical memory.
Explanation / Answer
a. In computing, virtual memory is a memory management technique that is implemented using both hardware and software. It maps memory addresses used by a program, called virtual addresses, into physical addresses in computer memory.The primary benefits of virtual memory include freeing applications from having to manage a shared memory space, increased security due to memory isolation, and being able to conceptually use more memory than might be physically available, using the technique of paging.
Virtual memory is always located on the hard drive. That is, after all, where the pagefile is, which is where virtual memory is stored. Virtual memory begins storing on your hard drive when your RAM no longer has sufficient memory for the tasks you are completing. Virtual memory is significantly slower than RAM and as such is used as a last resort - but the space is ALWAYS reserved on your hard drive so it can be used in an emergency situation.
b.When a page is required by the cpu then it is loaded into main memory for execution
Page table is mainted to load page into main memory.
Page tables are used to translate the virtual addresses seen by the application into physical addresses used by the hardware to process instructions; such hardware that handles this specific translation is often known as the memory management unit. Each entry in the page table holds a flag indicating whether the corresponding page is in real memory or not. If it is in real memory, the page table entry will contain the real memory address at which the page is stored. When a reference is made to a page by the hardware, if the page table entry for the page indicates that it is not currently in real memory, the hardware raises a page fault exception, invoking the paging supervisor component of the operating system.
c.After execution of the page the page still lies in the main memory till the time the main memory is full when the main memory becomes full then the pages are removed according to different algorithms such as LIFO,LRU,LFu optimal and so on.
d.The primary advantage and purpose of Virtual Memory is that it can extend the memory available to programs when physical RAM (chip-type memory) is very limited.
Other advantages are situational: Windows prefers to have at least a couple hundred MB of Virtual Memory, some games are written to use more Virtual memory than RAM memory, its possible that in some situations read/write to the hard drive may be speedier (especially while other read/write is happening for another reason).
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.