0% found this document useful (0 votes)
43 views18 pages

Virtual Memory Operating System

Virtual memory is a memory management technique that allows operating systems to simulate a larger memory space than physically available, enabling larger applications to run on limited RAM. It operates through a combination of hardware and software, mapping virtual addresses to physical addresses, and can lead to thrashing when excessive page swapping occurs. Effective page replacement algorithms are essential to minimize thrashing and maintain system performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views18 pages

Virtual Memory Operating System

Virtual memory is a memory management technique that allows operating systems to simulate a larger memory space than physically available, enabling larger applications to run on limited RAM. It operates through a combination of hardware and software, mapping virtual addresses to physical addresses, and can lead to thrashing when excessive page swapping occurs. Effective page replacement algorithms are essential to minimize thrashing and maintain system performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Unit 7

Virtual Memory
Virtual Memory
• Virtual memory is a memory management technique used by
operating systems to give the appearance of a large, continuous
block of memory to applications, even if the physical memory
(RAM) is limited.
• It allows the system to compensate for physical memory
shortages, enabling larger applications to run on systems with less
RAM.

• A virtual memory is an illusion of a memory that is larger than the


real memory.

• The basis of virtual memory is the noncontiguous memory


allocation model. The virtual memory manager removes some
components from memory to make room for other components.
Working of Virtual Memory
• It is a 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.

• All memory references within a process are logical addresses that


are dynamically translated into physical addresses at run time.

• This means that a process can be swapped in and out of the main
memory such that it occupies different places in the main memory
at different times during the course of execution.

• A process may be broken into a number of pieces and these pieces


need not be continuously located in the main memory during
execution. The combination of dynamic run-time address
translation and the use of a page or segment table permits this.
Page Fault Technique
• 1.FIFO Page replacement Algorithm
• 2.Optimal Page Replacement Algorithm
• 3.Least Recently Used Repalcement algorithm
Tharashing
All of the main memory will be occupied with
process pages, so that the processor and OS have
direct access to as many processes as possible.
Thus when the OS brings one page in, it must throw
another out.
If it throws out a page just before it is used, then it
will just have to get that page again almost
immediately. Too much of this leads to a condition
called Thrashing.
The system spends most of its time swapping pages
rather than executing instructions. So a good page
replacement algorithm is required.
Causes of Thrashing
1.Degree of Multiprogramming
• In the given diagram, the initial degree of
multiprogramming up to some extent of
point(lambda), the CPU utilization is very high and
the system resources are utilized 100%.
• But if we further increase the degree of
multiprogramming the CPU utilization will
drastically fall down and the system will spend
more time only on the page replacement and the
time taken to complete the execution of the
process will increase.
• This situation in the system is called thrashing.
2.Lacks of Frames
If a process has fewer frames then fewer pages
of that process will be able to reside in
memory and hence more frequent swapping
in and out will be required. This may lead to
thrashing. Hence a sufficient amount of
frames must be allocated to each process in
order to prevent thrashing.

You might also like