Why Is There A Need For Virtual Memory?: R: ET/COE/ND/19/003 Cousre: Cte 214 D: 6 S 2021
Why Is There A Need For Virtual Memory?: R: ET/COE/ND/19/003 Cousre: Cte 214 D: 6 S 2021
Why Is There A Need For Virtual Memory?: R: ET/COE/ND/19/003 Cousre: Cte 214 D: 6 S 2021
REG NO : ET/COE/ND/19/003
Ideally, the data needed to run applications is stored in RAM, where they can be
accessed quickly by the CPU. But when large applications are being run, or when
many applications are running at once, the system’s RAM may become full.
To get around this problem, some data stored in RAM that is not actively being used
can be temporarily moved to virtual memory (which is physically located on a hard
drive or other storage device). This frees up space in RAM, which can then be used to
accommodate data which the system needs to access imminently.
By swapping data between RAM and virtual memory when it is not needed and back
from virtual memory to RAM when it is needed, a system can continue to work
smoothly with far less physical RAM than it would otherwise require.
Virtual memory enables a system to run larger applications or run more applications
at the same time without running out of RAM. Specifically, the system can operate as
if its total RAM resources were equal to the amount of physical RAM, plus the
amount of virtual RAM.
Another key driver for the use of virtual memory is that all computer systems have a
limit (dictated by hardware and software) on the amount of physical RAM that can be
installed. Using virtual memory allows the system to continue to operate beyond those
physical RAM limits.
The responsibility for keeping track of all this data as it is swapped between physical
and virtual memory falls to the computer’s memory manager. The memory manager
maintains a table which maps virtual addresses used by the operating system and
applications to the physical addresses that data is actually stored in. When data is
swapped between RAM and virtual memory, the table is updated so that a given
virtual address always points to the correct physical location.
A computer can only run threads and manipulate data that is stored in RAM rather
than virtual memory. And it takes a non-negligible amount of time to swap data that is
needed into RAM. Consequently, it follows that using virtual memory involves a
performance hit.
Put another way, a system with 4 GB RAM will generally offer higher performance
than a system with 2 GB RAM and 2 GB virtual memory because of the performance
hit caused by swapping, and for that reason it is said that virtual memory is slower
than RAM.
One potential problem with virtual memory is that if the amount of RAM present is
too small compared to the amount of virtual memory then a system can end up
spending a large proportion of its CPU resources swapping data back and forth.
Meanwhile, performance of useful work grinds to a near halt – a process known
as thrashing.
To prevent thrashing it is usually necessary to reduce the number of applications
being run simultaneously, or simply to increase the amount of RAM in the system.
To minimize the performance hit caused by swapping between physical and virtual
memory, it is best use the fastest storage device connected to the system to host the
virtual memory, and to locate the virtual memory storage are
Virtual memory can act in concert with a computer’s main memory to enable faster,
more fluid operations.
In Windows, users can also allow the system to manage the amount of
virtual memory provided dynamically.
Similarly, in the Mac OS, users can use the preferences panel to allot virtual
memory.
Provides a way to increase memory which is less costly than buying more
RAM.
Takes up storage space which could otherwise be used for long term data
storage.
REFERENCE
From https://www.enterprisestorageforum.com/hardware/virtual-memory/