0% found this document useful (0 votes)
8 views11 pages

3rd Tamplate

Virtual memory is a memory management technique that creates an illusion of a larger main memory by utilizing both physical memory and disk storage. It allows for running large programs, multitasking, and provides memory protection, but can lead to slower performance and increased disk usage. Key components include virtual address spaces, page tables, and page replacement algorithms to manage memory efficiently.

Uploaded by

drsaiftahir560
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views11 pages

3rd Tamplate

Virtual memory is a memory management technique that creates an illusion of a larger main memory by utilizing both physical memory and disk storage. It allows for running large programs, multitasking, and provides memory protection, but can lead to slower performance and increased disk usage. Key components include virtual address spaces, page tables, and page replacement algorithms to manage memory efficiently.

Uploaded by

drsaiftahir560
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Group 5- Virtual Memory

Management
Group members:
Maryam Shabeer BSIT(M)-23-01
Mahnoor Fatima BSIT(M)-23-26
Mishal Shafiq BSIT(M)-23-31
Adeena Imran BSIT(M)-23-38
What is Virtual Memory?
 Virtual Memory is a memory management technique used by
modern operating systems (like Windows, Linux, macOS ) that
gives an illusion of a very large main memory (RAM), even if
the actual physical memory is small.
 It does this by using a combination of:
 Physical Memory (RAM)
 Disk Storage (like a hard drive or SSD)
 This technique allows programs to act as if they have access to
a large, continuous block of memory, regardless of how much
physical RAM is available.
Why Do We Need Virtual
Memory?
 1. To run large programs even if physical RAM is limited.
 2. To allow multiple programs to run at the same time without
interfering with each other.
 3. To provide memory protection between processes.
 4. To simplify programming by giving each process its own
address space.
How Virtual Memory Works
 Virtual memory uses logical addresses (virtual addresses)
instead of physical addresses directly.
 Here's how it works step-by-step:
 1. Virtual Address Space
 Each process gets its own separate address space, which is
divided into pages (typically 4 KB in size). These are called
virtual pages.
 2. Page Table
 The OS uses a page table to map virtual pages to physical
frames in RAM. Each process has its own page table. If a page
is not currently in RAM, the OS will bring it from disk (swap
space).
How Virtual Memory Works
 3. Translation by MMU (Memory Management Unit)
 The MMU is a hardware component that translates virtual
addresses to physical addresses using the page table.
 Example:
Virtual Address → MMU → Page Table → Physical Address
Paging in Virtual Memory
 Paging is the most common way to implement virtual memory.
 Virtual memory is divided into pages
 Physical memory (RAM) is divided into frames
 The OS keeps track of which virtual pages are stored in which
physical frames.
 Page Hit: If the page is in RAM → use it.
 Page Fault: If the page is not in RAM → OS loads it from disk
→ may need to swap out another page.-
Page Replacement Algorithms

 When RAM is full, the OS must decide which page to remove


to make space. This is done using a page replacement
algorithm like:
 1. FIFO (First In First Out): Oldest page is replaced.
 2. LRU (Least Recently Used): Least recently used page is
replaced.
 3. Optimal: Replace the page that won’t be used for the longest
time in the future (theoretical).
Thrashing
If the system spends more time swapping pages in and out than
executing actual programs → it’s called thrashing.
Happens when there's not enough RAM for the number of
running processes.
Advantages of virtual memory
 1. Increases Effective Memory — Allows programs to use
more memory than physically available.
 2. Memory Protection — Isolates processes, preventing
accidental or malicious memory access.
 3. Simplifies Programming — Developers can write programs
without worrying about memory limits.
 4. Efficient Multitasking — Enables multiple applications to
run simultaneously with better memory management.
 5. Handles Memory Fragmentation — Manages non-
contiguous memory allocation efficiently.---Disadvantages:
Disadvantages of virtual memory

 1. Slower Performance — Accessing data from disk (swap


space) is much slower than RAM.
 2. Increased Disk Usage — Heavy use of virtual memory can
wear out storage devices over time.
 3. System Thrashing — Excessive swapping between RAM
and disk can severely slow down the system.
 4. Higher Hardware Requirements — Needs sufficient disk
space and processing power to manage virtual memory
efficiently.
 5. Complex Management — Virtual memory management
adds complexity to operating system design.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy