VIRTUAL MEMORY
What is virtual memory?
Virtual memory is a method that computers use to manage storage space to keep systems running quickly and efficiently. Using the technique,?Virtual memory is a method that computers use to manage storage space to keep systems running quickly and efficiently. Using the technique, operating systems can transfer data between different types of storage, such as random access memory (RAM), also known as main memory, and hard drive or solid-state disk storage. At any particular time, the computer only needs enough active memory to support active processes. The system can move those that are dormant into virtual memory until needed.
Virtual memory is a built-in component of most modern desktop computers. It's part of a computer's CPU and is a more cost-effective method for managing memory than expanding its physical memory storage system. Some specialized computers might not rely on virtual memory because it could cause inconsistencies in how the computer processes information and runs tasks.
How does virtual memory work?
Virtual memory uses both the computer's software and hardware to work. It transfers processes between the computer's RAM and hard disk by copying any files from the computer's RAM that aren't currently in use and moving them to the hard disk. By moving unused files to the hard disk, a computer frees up space in its RAM to perform current tasks, such as opening a new application. If the computer later needs to use its RAM for a more urgent task, it can again swap files to make the most of the available RAM.
Types of virtual memory:
The two ways computers handle virtual memory are through paging and segmenting. Here are some of the differences between these types of virtual memory:
领英推荐
Paging:
Paging is a virtual memory technique that separates memory into sections called paging files. When a computer reaches its RAM limits, it transfers any currently unused pages into the part of its hard drive used for virtual memory. The computer performs this process using a swap file, a designated space within its hard drive for extending the virtual memory of the computer's RAM. By moving unused files into its hard drive, the computer frees its RAM space for other memory tasks and ensures that it doesn't run out of real memory.
Segmenting:
Segmentation is another method of managing virtual memory. A segmentation system divides virtual memory into varying lengths and moves any segments that aren't in use from the computer's virtual memory space to its hard drive. Like page tables, segment tables track whether the computer stores the segment in memory or a physical address. Segmentation differs from paging because it divides memory into sections of varying lengths, while paging divides memory into units of equal size. With paging, the hardware determines the size of a section, but the user can select the length of a segment in a segmentation system.
Limitations of virtual memory:
Virtual memory has many advantages, but it also has some limitations. Here are a few to keep in?mind: