Performance in virtual memory:
Assume that p is the page fault ratio. When value of p is 0 that means there is no page faults and all page references are hit. If the value of p is 1 that means there is no hit and all references are faults. The performance of virtual memory is depends on total number of page faults. The effective access time(EAT) can be found using formula:
EAT = (1 - p)*memory access time + (p)*page fault time.
Advantages and disadvantages of virtual memory:
The size of program can be more than the size main memory. Memory can be used efficiently because a section of program loaded only when it need in CPU. Virtual memory allows sharing of code and data, unlimited amounts of multiprogramming. We can reduce internal fragmentation using segmented paging and eliminates external fragmentation.
There are some disadvantages of using virtual memory that increased overhead for handling paging interrupts, software complexity and hardware costs.