The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+19 votes

Which of the following is/are advantage(s) of virtual memory?

  1. Faster access to memory on an average.
  2. Processes can be given protected address spaces.
  3. Linker can assign addresses independent of where the program will be loaded in physical memory.
  4. Program larger than the physical memory size can be run.
asked in Operating System by Veteran (52.1k points)
edited by | 2.8k views
what to write into answer block in case of two option?

We use valid/invalid bits in demand paging. 

If the bit is valid corresponds to particular virtual address, page is present in the physical memory & if it is invalid, page is either not present in the memory or address is not valid. So B is also one of the choice.

2 Answers

+34 votes
Best answer

Virtual memory provides an interface through which processes access the physical memory. So,

  1. Is false as direct access can never be slower.
  2. Is true as without virtual memory it is difficult to give protected address space to processes as they will be accessing physical memory directly. No protection mechanism can be done inside the physical memory as processes are dynamic and number of processes changes from time to time.
  3. Position independent can be produced even without virtual memory support.
  4. This is one primary use of virtual memory. Virtual memory allows a process to run using a virtual address space and as and when memory space is required, pages are swapped in/out from the disk if physical memory gets full.

So, answer is (B) and (D).

answered by Veteran (414k points)
edited by
I have a doubt that without virtual memory also protected address access can be given using base and limit registers only. plz clarify
not possible for a multiprocessing system.
@arjun sir, Why not C is the correct choice? How can we achieve this functionality without the use of VM ?
answer should be (d)

sir, protection we can provide through hardware called MMU or base+relocation register scheme also

in virtual memory, it is done by protection bit part of page table entry.
If we use different relocation address for each process, how many process can we run on a system with say 4GB of RAM? Basically we are dividing main memory here for different processes and so, assuming equal division, suppose each process takes 100 MB of memory we can have maximum 40 processes only including all system ones. This also means that there is no way for any process to use more than 100 MB of memory in any case. I do not think any such system exist except may be in embedded domain. For this question, 'b' is also an answer- you can refer use of virtual memory in any good book. Also, these questions of GATE 1999 were having multiple correct answers and only if all were marked, they gave marks.
@arjun sir i have a doubt that if there is no concept of virtual memory then  CPU can also generates virtual address (y/n) ?? i think yes then option d will be correct
plzz explain ... in detail
thnx ....

option B says: Processes "can be" given protected address spaces.


without  concept of virtual memory then  CPU can also generates virtual address (y/n) ?? - yes we can give virtual address( i am not sure i am thinking virtual adress as a logical address). 

mcjoshi  even "can " present in c stmt also so c can also be true if we consider b as true because of "can be". 

This qstn is asking advantage over other memory management techniues, i think only d will be correct

@Arjun sir. Why option a is false?With the help of VM we are able to put only required pages in the main memory.So,why a is false?If we dont have main memory and then if we load pages of a process,we might end up loading the unnecessary pages and left some necessary pages.?

I did  not understand the explanation for a point. Direct access can never be slower means?
@rahul sharma 5 .  "Faster access to memory on an average" - here they mean that if VM concept is used then memory access time would be less as compared to direct access. But it's not possible because in that case first virtual to physical address translation is required then only we can access MM. So here access time will be more.

@arjun Sir I think C should also be correct as question is asking only for advantages and not comparitive advantage over traditional methods. Also , by using VM

Linker "can" assign addresses independent of where the program will be loaded in physical memory.


@Soumya29 What is meant by direct access? I mean CPU generates LA (if VM concept is not used) and then MMU converts it to PA. So address translation is there from LA -----> PA

Thus what's direct MM access?

@Shaik brother can you pitch in?
@arjun sir

it is correct that using address translation scheme we can provide protection to only one process
+1 vote
should be B and D
answered by Loyal (6.8k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,811 questions
54,533 answers
75,578 users