📜  虚拟内存和缓存内存的区别

📅  最后修改于: 2021-09-27 15:46:31             🧑  作者: Mango

高速缓存存储器:
高速缓存提高了 CPU 的访问速度。它不是一种技术,而是一种存储单元,即存储设备。在高速缓存中,最近使用的数据被复制。每当程序准备好执行时,它就会从主内存中取出,然后复制到缓存中。但是,如果它的副本已经存在于缓存中,则直接执行程序。

虚拟内存:
虚拟内存增加了主内存的容量。虚拟内存不是存储单元,而是一种技术。在虚拟内存中,即使是比主内存大的程序也可以被执行。

虚拟内存和缓存内存的区别:

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.