Virtual Memory Is A Technique For Managing Memory That Lets Computers Make Up For A Lack of Physical Memory by Using Secondary Memory

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

A.

BRIEF OVERVIEW OF VIRTUAL MEMORY AND ITS IMPORTANCE IN


OPERATING SYSTEMS.
i. BRIEF OVERVIEW OF VIRTUAL MEMORY
Virtual memory is a technique for managing memory that enables computers to use secondary
memory so as to compensate for the scarcity of actual physical memory. When there is not enough
RAM on a computer to execute instructions, virtual memory enables applications to use a broader
address space than the available physical memory. To achieve this, the program and data are
divided into smaller chunks known as pages, which are then switched between the disk and
physical memory as needed (Tanenbaum & Bos 2022). Computers can run sophisticated and
complex programs due to the presence of virtual memory, which satisfies the competing memory
needs of several programs in a fixed memory region.
ii. THE IMPORTANCE OF VIRTUAL MEMORY IN OPERATING SYSTEM
1. The operating system uses virtual memory instead of mapping the entire program into RAM
so as to conserve physical memory and make it more efficient use of available resources. A
software may use more memory than the system can physically hold when it is being
performed. In this instance, virtual memory enables the operating system to replace less
frequently used software or data to disk and load just the portions of the program and data
that are now needed into physical memory. This lowers the amount of physical memory
needed to execute each application and enables numerous programs to share the limited
physical memory resources (simplilearn, 2023).
2. Virtual memory allows the operating system to protect the memory space of each program
from other programs and the operating system itself. This is possible as since each program
run its own virtual address space and cannot access the memory space of the other program
hence providing a level of security and stability to the system.
3. Allowing computers to run programs that are larger than their physical memory

B. EXPLANATION OF VIRTUAL MEMORY MANAGEMENT IN PRACTICE AND


WHY IS NECESSARY.

I. PAGING
 Paging is a storage mechanism used to retrieve processes from the secondary storage into
the main memory in the form of pages.
 The idea behind paging is that the physical memory is divided into fixed-size blocks
called page frames, which are the same size as the pages used by the process. The
process’s logical address space is also divided into fixed-size blocks called pages, which
are the same size as the page frames. When a process requests memory, the operating
system allocates one or more page frames to the process and maps the process’s logical
pages to the physical page frames (Stallings, 2012).

II. SEGMENTATION
 Segmentation is a memory administration approach used in operating system that divides
memory into logical multiple sized segments of variable sizes. Each segment represents a
different portion of the program.
 In virtual memory segmentation each process is divided into multiple segments and all of
them to not necessarily reside at one point at a time. The information regarding the
segments are stored in segment table that helps in mapping of the two dimensional logical
addresses to physical addresses (Khurana, 2011)

In practice, modern operating system use a combination of paging and segmentation to


manage virtual memory efficiently. This approach, known as segmentation paging or
paging with segmentation, combines the benefits of both techniques.
The operating system dynamically allocates and manages memory segments and pages to
meet the memory requirement of running process while optimizing memory utilization.
III. PAGE FAULT HANDLING

 A page fault is an exception raised by the memory management unit that happen if a
program tries to access a piece of memory that does not exist in physical memory (main
memory). The exception usually instructs the machine to find this data block within virtual
memory, that way it can be sent to the physical memory from storage devices (Ramesh,
2010).
 A page fault usually happens when a process tries to access memory located in a virtual
address space that it is not authorized to access. When this occurs, the kernel must act in
order for the process to be allowed to continue executing.

WAYS OF HANDLING PAGE FAULT

i. Use of swapping technique, whereby the operating system retrieves the page from
secondary storage into free frame in RAM
ii. Pre fetching
iii. Demand paging

IV. MEMORY MANAGEMENT UNIT (MMU)

 A memory management unit (MMU) is a hardware component in computer that is


responsible in virtual-to-physical memory address translation (Blokdyk, 2018).
 The MMU works in conjunction with the operating system’s memory management
mechanisms, including paging and segmentation to manage memory access efficiently.
MMU has the following functions .Address translation, memory protection and virtual
memory management.
MMU ensures efficient memory utilization, by dynamically controlling the mapping
between virtual and physical addresses. It also ensured enhanced security.
References
Blokdyk, G. (2018). Memory Management Unit: A Complete Guide. (n.p.). CreateSpace Independent
Publishing Platform.

Kanade, V. (2023, march 31). What Is Virtual Memory? Meaning, Architecture, Benefits and Challenges.
Retrieved from Spiceworks: https://www.spiceworks.com/tech/devops/articles/what-is-virtual-
memory/#:~:text=Virtual%20memory%20is%20defined%20as,multitasking%20capabilities%2C%
20and%20data%20security.

Ramesh, S. (2010). Principles of Operating Systems. Laxmi Publications Pvt Limited.

simplilearn. (2023, october 30). Virtual Memory: Everything You Need to Know. Retrieved from
simplilearn: https://www.simplilearn.com/virtual-memory-article

Stallings, w. (2012). In Operating Systems: Internals and Design Principles. Prentice Hall.

Tanenbaum, A. & Bos,H. (2022). Modern Operating Systems. Pearson.

You might also like