Virtual Memory A Fundamental Concept in Computer Design
Virtual Memory A Fundamental Concept in Computer Design
A Fundamental
Concept in
Computer Design
Virtual memory is a powerful concept in computer architecture that
allows programs to utilize more memory than is physically available.
By providing an abstraction layer between physical and logical
memory, virtual memory enhances efficiency, flexibility, and security.
by Eesha priya
What is Virtual Memory?
Memory Abstraction Demand Paging
Virtual memory creates a logical Virtual memory only loads page
address space that is segments of a program into
independent of the physical physical memory when they are
memory layout, allowing needed, reducing the initial
programs to access more memory footprint.
memory than is physically
available.
2 Page Tables
Page tables map virtual page numbers to physical frame
numbers, enabling the translation of virtual to physical addresses.
Virtual memory divides the logical Page tables store the mapping Each page table entry contains
address space into fixed-size pages, between virtual pages and physical information about the corresponding
which are mapped to physical frames, enabling efficient address physical frame, such as access
memory frames. translation. permissions and presence in
memory.
Swapping and Paging Policies
Swapping
When physical memory is full, the operating system swaps
unused pages to secondary storage, such as a hard drive or
SSD, to free up space.
Page Replacement
The operating system uses page replacement algorithms, like
Least Recently Used (LRU), to determine which pages to swap
out of memory.
Demand Paging
Pages are only loaded into physical memory when they are first
accessed, reducing the initial memory footprint of a program.
Benefits of Virtual Memory
Larger Programs
Virtual memory allows programs to access more memory than is physically
available, enabling larger and more complex applications.
Efficient Utilization
By only loading required pages into physical memory, virtual memory improves
overall system efficiency and resource utilization.
Enhanced Security
Virtual memory provides memory isolation, preventing unauthorized access and
improving the overall security of the system.
Challenges and Limitations
1 Performance 2 Memory
Overhead Fragmentation
The address translation Repeated allocation and
process and memory deallocation of memory
swapping can introduce can lead to fragmentation,
latency and reduce overall reducing the efficiency of
system performance. physical memory usage.
3 Address Translation
The memory management unit translates virtual addresses to
physical addresses using page tables and the translation
lookaside buffer.