The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+16 votes
2.1k views

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 (59.5k points)
edited by | 2.1k views
0
what to write into answer block in case of two option?
0

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

+30 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 (355k points)
edited by
+3
I have a doubt that without virtual memory also protected address access can be given using base and limit registers only. plz clarify
+3
not possible for a multiprocessing system.
+1
@arjun sir, Why not C is the correct choice? How can we achieve this functionality without the use of VM ?
–1
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.
+5
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.
0
@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 ....
+3

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

0

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

0
@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?
0
@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.
+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

37,996 questions
45,492 answers
131,517 comments
48,592 users