0% found this document useful (0 votes)
39 views3 pages

Virtual Memory and Its Concepts

1. Virtual memory is a memory management technique that extends the amount of main memory available to running processes using secondary storage such as a hard disk. It provides an illusion to programs that they have a very large memory. 2. Virtual memory is implemented using demand paging, where pages of processes are loaded into main memory on demand from secondary storage. When a page referenced by the CPU is not in main memory, a page fault occurs and the page must be loaded. 3. Common page replacement algorithms used to determine which page to remove from main memory to make room for a new page include first-in, first-out (FIFO), least recently used (LRU), and optimal page replacement. Thrashing

Uploaded by

Renas H.Darweesh
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)
39 views3 pages

Virtual Memory and Its Concepts

1. Virtual memory is a memory management technique that extends the amount of main memory available to running processes using secondary storage such as a hard disk. It provides an illusion to programs that they have a very large memory. 2. Virtual memory is implemented using demand paging, where pages of processes are loaded into main memory on demand from secondary storage. When a page referenced by the CPU is not in main memory, a page fault occurs and the page must be loaded. 3. Common page replacement algorithms used to determine which page to remove from main memory to make room for a new page include first-in, first-out (FIFO), least recently used (LRU), and optimal page replacement. Thrashing

Uploaded by

Renas H.Darweesh
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/ 3

Journal of Advances and Scholarly Researches in Allied Education

Vol. 16, Issue No. 1, January-2019, ISSN 2230-7540

Virtual Memory and its Concepts

Ms. Parveen Kaur*

Assistant Professor in Computer Department, DAV College for women, Ferozepur Cantt, India

Abstract – This paper will provide you brief description about virtual Memory, its benefits and uses. Virtual
memory is the base of modern applications. In Virtual Memory the concept of demand paging is used. All
programs require memory to run on computer. When we want to run more than 1 process at same time
than operating system take the responsibility to ensure that there is enough memory for each and every
process. In this paper I provide you full fledge information about virtual memory, its uses, when we need it
and how it is used. All programs stored in permanent memory. When a program is executed it is first
loaded in main memory i.e. RAM (Random Access memory) which is very expensive and that is why
Computers have limited amount of RAM. Now days Virtual Memory is used in all modern applications
because it help us to extend the main memory without increasing the size of RAM which is very
expensive. We extend the main memory with the help of secondary memory. Virtual memory is useful in
two ways. First, it extends the physical memory with the help of secondary memory. Second, it provides
us memory protection, because each virtual address is translated to a physical address.

Keywords: Virtual memory, virtual memory implementation, memory protection, demand paging, swaps
in and swap out, page replacement algorithms, thrashing.

-----------------------------------X----------------------------------

I. INTRODUCTION use and use the concept of virtual memory when


there is requirement because with the use of virtual
Virtual memory is a part of secondary memory that memory both cost and performance is reduce.
acts like main memory. If you want to run multiple
applications at the same time than all applications 2. IMPLEMENTATIONS OF VIRTUAL
must be loaded into main memory but it is not MEMORY: DEMAND PAGING
possible with small size RAM. At that time Virtual
memory is used and balances the process. Virtual The concept of Virtual memory is implemented
memory is a memory management technique. Virtual using the concept of demand paging. Loading the
memory provides an illusion to programmers that page into memory on demand of CPU is called
they have very large main memory but in reality demand paging. In demand paging the concept of
users have very small memory. In this when multiple swapping is used. In Swapping we can put process
processes are running at same time than computer from main memory to secondary memory that is
looks for the part of processes or complete called swap out and we can bring back processes
processes which are not used by the CPU or which from secondary to main memory it is called swap
are currently inactive and put it into the secondary in. In demand paging process is divided into
memory that is known as virtual memory to free up various pages & every page is given a unique
the space on the RAM. When a part or full process is address. At a time all the pages of a process are
needed than it brings back to the RAM from the disk. not brought in the main memory only some of the
This increase the CPU utilization and throughput. pages related to the pages are brought in main
This is possible because at one point of time CPU memory because at one point of time a CPU don‘t
can execute only one process. In this way we can need all the pages in the main memory for
run multiple processes at the same time with limited execution of program only some of the pages are
physical memory (RAM). But the disk runs much needed, remaining pages can be brought on the
slower than RAM, when we have to run multiple or demand of CPU. When CPU needs those pages
large applications it is best to have as much physical which are not available in the main memory; it is
memory if possible because the more RAM a called page fault. Page fault means the page
www.ignited.in

computer has the fast it will run. Virtual memory referenced by the CPU is not available in the main
provides us a solution when we have limited RAM memory and it is to be searched in the secondary
but if we use more virtual memory than performance memory .Whenever the page fault occur the time
of our computer is degraded. So to get fast response taken to service the page fault is called as page
from your computer use as much RAM as you can fault service time. In page fault service time when

Ms. Parveen Kaur*


58
Virtual Memory and its Concepts

required page is found in the secondary memory divided into local and global page replacement
than we have to bring that page from secondary to algorithms. In local page replacement algorithm only
main memory page related to the same process is replaced and in
global replacement algorithm page related to any
process can be replaced. Global page replacement
algorithms are more complex to implement.

The commonly used algorithms are:

1. First in First out (FIFO): In first in first out


a page which comes first in main memory is
out first. It means pages are replaced
according to their arrival. For example if
there are 3 Frames in main memory and
pages are P1, P2, P3, P4, P5, and P6.
First of all P1 comes

Then P2, P3 now p1 is removed and p4 is enter in


main memory similarly p2 remove and p5 is enter
and so on….

In the above diagram we have 2 processes , process Problem in FIFO: Belody Anomaly: When we
A and process B. Suppose Process A has 6 pages 0 increase the no. of frames than no. of page fault
To 5 and process B has 4 pages 6 to 9 but there are also increased this problem is called belody
only 4 pages of process A and 3 Pages of Process anomaly.
B are in primary memory and other pages are in
secondary memory whenever 2. Optimal Page Replacement Algorithm
(OPT): In this algorithm we see the future;
The other pages are required by the CPU they are it means a page which comes late in near
Swapped in and out from the main memory to future is replaced first. It is the most
secondary memory according to the requirement. efficient algorithm because it provides
minimum page faults.
Let main memory (MM) access time = ‗M‘
3. Least recently used algorithm (LRU): In
Page fault service time = ‗S‘ this algorithm we see the past, it means a
page which used least recently is replaced
Page fault rate = ‗P‘ first.

Now the effective memory access time (EMAT) = 4. THRASHING


P(S) + (1-P) (M)
In the initial degree of multiprogramming up to
Main memory access time means time require to some instant of time (t), the CPU utilization is very
access the main memory. Page fault service time high and system resources are utilized by 100%.If
means time require to find page in secondary we further increase the degree of
memory and bring that page in main memory. multiprogramming, CPU utilization will be fall down
and system will spend more time in the page
Page fault rate means how frequently the page fault replacement and the time taken to complete the
occurs. execution of the process will be increase. This is
called thrashing. So when system spends more
3. PAGE REPLACEMENT ALGORITHMS time in page replacement rather than execution of
the process is called thrashing.
When page fault occur then we have to search that
paper in secondary memory and bring that page from Causes of Thrashing:
secondary to main memory. But the problem is that
main memory is already full? How can we put require There are basically 2 reasons of thrashing
page in main memory at that time page replacement
algorithms are used. The pages are swapped in and 1. High degree of multiprogramming
www.ignited.in

out on according to these page replacement


algorithms. There are no. of algorithms are available. 2. Lack of frames.
Every algorithm has its own functionality and we
have to select algorithm which best suits to our
requirement. Page replacement algorithm can be

Ms. Parveen Kaur*


59
Journal of Advances and Scholarly Researches in Allied Education
Vol. 16, Issue No. 1, January-2019, ISSN 2230-7540

Recovery of Thrashing: 2. Peter Hornyack Luis Ceze Steve Gribble


Dan Ports Hank Levy \‖A Study of Virtual
1. Do not allow the system to go in thrashing Memory Usage and Implications for Large
and instruct the long term scheduler (LTS) Memory‖ (PDF) \ University of Washington.
not to bring the process into the memory
after the point of (t). 3. Dr. Vivek Chaplot \ BNPG college \‖Virtual
Memory Benefits‖\\ Research Article \ Survey
2. If the system is already in thrashing than Paper \ Case Study \ Udaipur \Rajasthan
instruct the medium term scheduler (MTS) to (2016)‖. www.ijarcsms.com‖.
suspend some of the processes so that we
can recover the system from thrashing. 4. Sumit Sehgal \ Virtual Memory (Research
Paper) (2003)\http://www.daneprairie.com.
Advantages of Virtual Memory:
5. Assistance Prof. Dr. Qasim Mohammed
1. The use of Virtual memory is easy and Hussein \Virtual Memory (PDF) \ Tikrit
cheap University (2015).

2. It allows demand paging. 6. https://www.academia.edu. ―Memory


management in computer‖.
3. It provide efficient swapping
7. http://www.researchgate.net. ―Virtual
4. It provide the facility to run more than 1 memory concepts‖.
applications same time.

5. With virtual memory we can run large


applications with less RAM. Corresponding Author

Disadvantages of Virtual Memory: Ms. Parveen Kaur*

1. More access time. Assistant Professor in Computer Department, DAV


College for women, Ferozepur Cantt, India
2. Because of large access time applications
run slower. [email protected]

.3. Complexity is high.

4. It takes more time when need switching


between processes.

5. Overhead of swapping.

CONCLUSION

The concept of Virtual Memory is very useful


because it increases the utilization of memory and
provides us the cheapest way to run multiple
programs simultaneously with less RAM.

But the more use of virtual memory slow down the


performance of our computer because more time is
taken to access secondary memory as compare to
RAM. It is useful when we use it in small amount so
its use in large applications in large amount may
reduce the overall performance of applications.

REFERENCES:
www.ignited.in

1. Muhammad Abdullah Awais/ Memory


Management: Challenges and Techniques
for Traditional Memory Allocation Algorithms
MS150200157, Virtual University of Pakistan
(2016)\ [email protected].

Ms. Parveen Kaur*


60

You might also like