Open In App

Difference between Virtual memory and Cache memory

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

Cache Memory: Cache memory increases the accessing speed of CPU. It is not a technique but a memory unit i.e a storage device. In cache memory, recently used data is copied. Whenever the program is ready to be executed, it is fetched from main memory and then copied to the cache memory. But, if its copy is already present in the cache memory then the program is directly executed. 

 

Virtual Memory: Virtual Memory increases the capacity of main memory. Virtual memory is not a storage unit, its a technique. In virtual memory, even such programs which have a larger size than the main memory are allowed to be executed. 

Difference between Virtual memory and Cache memory:

S. No. Virtual Memory Cache Memory
1. Virtual memory increases the capacity of main memory. While cache memory increase the accessing speed of CPU.
2. Virtual memory is not a memory unit, its a technique. Cache memory is exactly a memory unit.
3. The size of virtual memory is greater than the cache memory. While the size of cache memory is less than the virtual memory.
4. Operating System manages the Virtual memory. On the other hand hardware manages the cache memory.
5. In virtual memory, the program with size larger than the main memory are executed. While in cache memory, recently used data is copied into.
6. In virtual memory, mapping frameworks is needed for mapping virtual address to physical address. While in cache memory, no such mapping frameworks is needed.
7. It is not as speedy as cache memory. It is a fast memory.
8. Those data or programs are kept here that are not completely get placed in the main memory. The frequently accessed data is kept in cache memory in order to reduce the access time of files.
9. Users are able to execute the programs that take up more memory than the main memory. The time required by CPU to access the main memory is more than accessing the cache. That is the reason frequently accessed data is stored in cache memory so that accessing time can be minimized.

Last Updated : 22 Feb, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads