Everything You Need to Know About Virtual Memory
Computer memory has come a long way in a short time with improving speed and capacity. Computers used to be slow in comparison and it was cumbersome to run too many applications at once. Now, hundreds of different applications can run at the same time thanks to advances in memory technology. Here are reasons why companies are looking at virtual memory to significantly expand memory capacity.
How Virtual Memory Works
Modern computers commonly use CPUs with 32 or 64 megabytes of RAM, which is not enough to run multiple robust programs at once. Virtual memory finds unused areas of RAM and automatically copies it on the hard disk, freeing up space. The RAM image is stored in a page file on the hard disk, which is indicated by the SWP extension on a Windows machine.
Virtual memory combines hardware and software. It is similar to physical memory but uses virtual addresses to locate a page frame. Virtual addresses are comprised of a virtual page number and a page offset while the page frame encompasses a page frame number and data. A page table lists virtual addresses and indicates whether the page frame with data is listed in physical memory. When a virtual address is not associated with space in physical memory, the page on disk is sent to a page frame in a process called paging or swapping.
Benefits of Virtual Memory
One of the main benefits of virtual memory is that it frees applications from having to share memory space and allows computers to run larger and programs than what is available with just physical memory (RAM). This strategy saves money because hard disk space costs much less than RAM chips. For greatest efficiency and speed it's best to use as much RAM as possible before relying on virtual memory.
Another major benefit of virtual memory, which is controlled by the operating system and the processor's memory management unit (MMU), is that it protects and isolates memory between applications or processes. Overall, virtual memory is now considered an essential part of modern computer architecture because of how much storage space it provides.