Virtual memory

From WikiMD's Food, Medicine & Wellness Encyclopedia

Virtual memory
University of Manchester Atlas, January 1963

Virtual memory is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a very large (main) memory." The operating system uses a combination of hardware and software to enable the total virtual address space available to an application or process to be larger than the physical memory in the computer. The concept of virtual memory is central to modern computer architecture, operating systems, and programming models.

Overview[edit | edit source]

Virtual memory involves the separation of logical memory from physical memory. This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Following this model, the concept of a virtual address space is used, where an address does not directly correspond to a physical location in memory. Instead, the operating system maintains a page table that maps virtual addresses to physical addresses. These mappings may change over time in response to the needs of the application and the system.

How Virtual Memory Works[edit | edit source]

When a program tries to access a location in its virtual address space, the operating system checks the page table to determine whether the page is in physical memory (RAM). If it is, the operating system translates the virtual address to a physical address, allowing the CPU to access the data. If the page is not in RAM, a page fault occurs, prompting the operating system to load the required page into physical memory. This process may involve swapping out another page to a swap file or swap partition on the disk, a process known as paging or swapping.

Benefits[edit | edit source]

Virtual memory offers several benefits:

  • It allows more processes to run simultaneously than would otherwise be possible, by sharing the physical memory among multiple processes.
  • It simplifies memory management by providing each process with a contiguous block of addresses.
  • It isolates each process from others, improving security and stability.
  • It enables applications to use more memory than is physically available on the system.

Challenges[edit | edit source]

However, virtual memory can also introduce challenges:

  • Accessing disk storage is much slower than accessing RAM, so performance can suffer if the system has to swap pages frequently (a situation known as thrashing).
  • The complexity of managing virtual memory can increase the overhead of the operating system.

Implementation[edit | edit source]

The implementation of virtual memory can vary between different operating systems and hardware architectures. However, common elements include the use of page tables to map virtual addresses to physical addresses and the use of a Memory Management Unit (MMU) to automate the translation of addresses at runtime.

See Also[edit | edit source]

Wiki.png

Navigation: Wellness - Encyclopedia - Health topics - Disease Index‏‎ - Drugs - World Directory - Gray's Anatomy - Keto diet - Recipes

Search WikiMD


Ad.Tired of being Overweight? Try W8MD's physician weight loss program.
Semaglutide (Ozempic / Wegovy and Tirzepatide (Mounjaro) available.
Advertise on WikiMD

WikiMD is not a substitute for professional medical advice. See full disclaimer.

Credits:Most images are courtesy of Wikimedia commons, and templates Wikipedia, licensed under CC BY SA or similar.


Contributors: Prab R. Tumpati, MD