Difference between Virtual Memory and Cache Memory
Key Difference: Virtual memory is an abstraction of the main memory. It extends the available memory of the computer by storing the inactive parts of the content RAM on a disk. when the content is required, it fetches it back to the RAM. Cache memory is used to store frequently accessed data in order to quickly access the data whenever it is required. They both are conceptually the same; however they mainly differ in the matter of implementation which results in different aspects like speed and control mechanism.
include("ad4th.php"); ?>Virtual memory is an abstraction of the main memory. It is used to hide the information of the real physical memory of the system. It extends the available memory of the computer by storing the inactive parts of the RAM's content on a disk. When the content is required, it fetches it back to the RAM. Virtual memory creates an illusion that a user has one or more contiguous address spaces that begin with address zero.
Virtual memory generates addresses in one of three ways (for RISC machines) – a load instruction, a store instruction or by fetching an instruction. Virtual memory has several advantages as it uses main memory efficiently. It simplifies memory management as each process acquires the same uniform linear address space. It also isolates address spaces and avoids any process memory clashes.
include("ad3rd.php"); ?>Cache Memory is a small and high speed memory. It stores data from those addresses of the main memory which are used several times. It can be available as a reserved part of the main memory or exist as an independent high speed storage device. Cache memory can be accessed at a very fast rate than in comparison to normal main memory.
If a processor needs to write or read a location in main memory, it checks the availability of the memory location in the cache. It is done by comparing the address of the memory location to all the tags in the cache which have the possibility of containing that particular address. In case the memory location in found in the cache, it is regarded as a Cache hit, and if not, then in that case it is regarded as a Cache miss.
Virtual and cache memory are conceptually the same. However, they differ in the terms of implementation. This is due to the speed requirements of cache.
Comparison between Virtual Memory and Cache Memory:
|
Virtual Memory |
Cache Memory |
Definition |
Virtual memory is an abstraction of the main memory. It extends the available memory of the computer by storing the inactive parts of the content RAM on a disk. It fetches it back to the RAM when the content is required. |
Cache memory is used to store frequently accessed data in order to quickly access the data whenever it is required. They both are conceptually the same; however they mainly differ in the matter of implementation. |
Purpose |
It extends the memory capacity of a computer beyond the one that is installed.
|
It reduces the amount of time needed to access the data.
|
Speed |
It operates in the millisecond range. |
It operates in the nanosecond range. |
Control mechanism |
Managed by the operating system |
Managed automatically by the hardware |
Component |
It is a part of the hard drive (secondary storage). |
Located on the processor itself |
Image Courtesy: wikimedia.org, moodle.schoolnet.lk
Comments
Nihla
Sun, 03/11/2018 - 00:11
Meer Aasif
Thu, 12/28/2017 - 19:19
praful dulal
Mon, 12/04/2017 - 12:08
venkat
Sun, 10/29/2017 - 17:56
MRX
Fri, 05/12/2017 - 10:20
SNEHA
Thu, 10/13/2016 - 22:56
TuRKeY
Mon, 12/07/2015 - 19:30
Nice difrent between catche and virtual memory and good definations
Roshan yadav
Mon, 02/02/2015 - 22:06
Add new comment