in Operating System
1,107 views
1 vote
1 vote
How does the virtual memory separates the logical memory as perceived by users from physical memory?

Is it because we can load program with larger address space then physical memory but still we need physical memory to load our pages don't we ? Then what does the above statement actually trying to convey ?
in Operating System
by
1.1k views

1 Answer

2 votes
2 votes

Virtual memory is not a separator between logical and physical memory

Actually in a CPU RAM is called Physical Memory and when we create a process Logical Memory is created. Now suppose we create one process with 6 block sequentially. But it is not guaranteed that those 6 blocks are also sequentially present in RAM. To connect between Physical address with Logical address, we need Page Table. Page table maps Physical address to Logical address.

Now, RAM may not contain all logical address of the process. If we are not getting the page that we needed, then it is called Page Fault of the process. In the page table those pages are indicated as Dirty Bit.

To overcome page fault we need to swap in those pages, from Secondary memory to Main memory.And those are done by FIFO, LRU,LFU page replacement policies.

4 Comments

Mam,all that i know but please have a look at this :)

"

Virtual memory involves the separation of logical memory as perceived
by users from physical memory. This separation allows an extremely large
virtual memory to be provided for programmers when only a smaller physical
memory is available (Figure 9.1). Virtual memory makes the task of programming
much easier, because the programmer no longer needs to worry about
the amount of physical memory available; she can concentrate instead on the
problem to be programmed.

"     ---From Galvin

what does this mean then
0
0
Mam i know how this mapping works and how large program then physical address space can work but still i didn't get what it is trying to convey from first line i.e. the separation between address spaces.
0
0

Virtual memory involves the separation of logical memory as perceived
by users from physical memory.

Actually virtual memory is another name of logical memory.  Logical memory contains the program written by user, which is much larger than the physical memory or RAM size. But as virtual memory size and physical memory size different, program shouldnot run due to lack of memory. But that will not be case. Because when we run a program we work on physical memory. And physical memory work as swap in and swap out manner with secondary memory. So,there is no lack of space and programmer could write a code much larger than physical memory ,without even worrying about it

0
0
For this advantage even two or three program can run at same time at CPU
0
0

Related questions

1 vote
1 vote
1 answer
3
Na462 asked in Operating System Sep 29, 2018
718 views
Na462 asked in Operating System Sep 29, 2018
by Na462
718 views