Nepedia
Back to Discover
Advanced Reader
💻

Virtual memory

technology Maturity 7-9 Next article →

Virtual memory, also known as virtual storage, is a sophisticated memory management technique used in modern computing. It provides an idealized abstraction of the actual storage resources available on a machine. This process creates a powerful illusion for users, making it seem as if the computer has a very large amount of main memory. In reality, the system is combining active RAM with inactive memory stored on secondary storage, such as a disk.

Virtual memory
Virtual memory

This allows a computer to reference more memory than is physically present in the hardware.

The mechanism relies on a precise mapping process between different types of addresses. A computer program uses virtual addresses, which are essentially placeholders. The operating system, working with specialized hardware, maps these into physical addresses in the actual computer memory. This translation is handled by a component in the CPU called the Memory Management Unit, or MMU. The MMU automatically converts the virtual addresses used by a process into the real physical locations. This allows the main storage to appear to a task as a single, contiguous collection of segments.

Most modern implementations use a specific method called paging to organize this space. In paged virtual memory, the virtual address space is divided into small, contiguous blocks known as pages. On contemporary systems, these pages are usually at least 4 kilobytes in size. To keep track of everything, the system uses page tables. Each entry in a page table contains a flag indicating if a page is currently in the real memory. If the hardware looks for a page and finds it is not in the real memory, it triggers a page fault exception. This exception tells the operating system's paging supervisor to retrieve the necessary data from secondary storage.

There are several ways these tables can be organized to manage different tasks. A system might use one single page table for the entire system, or it may provide separate page tables for every individual process. Some systems use segment tables, or even complex trees of region tables, to manage these address spaces. When each process runs in its own dedicated address space, it appears to have sole access to the virtual memory. This provides significant benefits, such as memory isolation, which increases security by preventing one process from interfering with another. It also allows different processes to share memory used by common libraries.

The history of virtual memory is rooted in the high cost of computer memory during the 1950s and 1960s. During this era, programmers had to manually manage data transfers using a technique called overlaying. The first true virtual memory system was implemented at the University of Manchester for the Atlas Computer.

University of Manchester Atlas, January 1963
University of Manchester Atlas, January 1963

The Atlas was commissioned in 1962, though paging prototypes existed by 1959. It mapped virtual addresses onto 16,384 words of primary core memory and 98,304 words of secondary drum memory. This innovation solved the difficult problem of scheduling data transfers and recompiling programs for different memory sizes.

Many researchers contributed to the evolution of these concepts. In 1958, Robert S. Barton suggested that memory should be allocated automatically to replace manual overlays. By 1964, the Burroughs Corporation released the B5000, which was the first commercial computer to feature virtual memory. IBM also made major contributions, developing hypervisors and the Virtual Machine Facility/370. By 1969, the debate over whether virtual memory was effective for commercial use ended. An IBM research team led by David Sayre proved that their virtual memory overlay system worked better than manual systems.

While virtual memory is standard today, it is not used in every type of computing. Embedded systems or special-purpose computers often skip virtual memory to ensure fast and consistent response times. Virtual memory can cause unpredictable delays if a system must wait to read data from secondary memory. Furthermore, the hardware required for address translation, like the MMU, takes up significant space on a chip. This is why some smaller embedded chips do not include the necessary hardware. However, for most general-purpose computers, the ability to run large software on limited physical memory makes virtual memory an essential tool.

684 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
File:Virtual memory.svg
Virtual memory.svg
File:University of Manchester Atlas, January 1963.JPG
University of Manchester Atlas, January 1963.JPG
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.