虚拟内存做缓存
高速缓存存储器 (Cache Memory)
In memory hierarchy, there is an additional level of memory which is Cache. It is high-speed storage and much faster than the main storage. It is much expensive as compared to main storage. So, a relatively small amount of cache is used.
在内存层次结构中,还有一个额外的内存级别,即“缓存”。 它是高速存储,比主存储要快得多。 与主存储相比,它昂贵得多。 因此,使用了相对少量的缓存。
Programs and data need to be in main storage to be executed. Program or data not needed immediately may be kept on secondary storage until needed and then brought into main memory for reference.
程序和数据需要在主存储器中才能执行。 不需要的程序或数据可立即保存在二级存储中,直到需要时再放入主存储器中以供参考。
Cache storage imposes this level of shuttling on the system. Programs in the main memory shuttled to the cache before being executed. In the cache, they may be executed much faster than in the main storage.
高速缓存存储在系统上施加了此级别的穿梭。 主存储器中的程序在执行前先移入高速缓存。 在缓存中,它们的执行速度可能比在主存储器中快得多。
There is a cache hit when the cache has a copy of the required data and there is a cache miss if the cache does not have a copy of that data item.
当高速缓存具有所需数据的副本时,将发生高速缓存命中;如果高速缓存没有该数据项的副本,则将发生高速缓存未命中。
The overhead involved in shuttling programs back and forth will be reduced so the performance increase obtained by the faster execution possible in the cache.
来回穿梭程序所涉及的开销将减少,因此通过在缓存中更快地执行可能获得的性能提高。
Cache memory is a faster memory type that acts as a buffer between main memory and the processor.
高速缓存是一种较快的内存类型,可充当主内存和处理器之间的缓冲区。
虚拟内存 (Virtual Memory)
It is a memory management scheme that permits the execution of various processes which may not be entirely in RAM. It is possible that user programs can be larger than physical memory.
它是一种内存管理方案,允许执行可能不完全位于RAM中的各种进程。 用户程序可能大于物理内存。
A 'swap file' is created in this area which is used to sustain data which the processor does not need in a frequent amount of time.
在该区域中创建了一个“交换文件”,用于维持处理器不需要的频繁数据。
It makes the programming much simpler because the programmer doesn't have to take care of the size of the physical memory available.
它使编程变得更加简单,因为程序员不必照顾可用物理内存的大小。
By this CPU utilization and throughput increases as the user utilizes less physical memory. So more users can keep their programs in memory.
这样,随着用户使用更少的物理内存,CPU利用率和吞吐量就会提高。 因此,更多用户可以将其程序保留在内存中。
![Cache Memory and Virtual Memory | Operating System](https://www.includehelp.com/operating-systems/images/cache-memory-and-virtual-memory.jpg)
虚拟内存与高速缓存之间的差异/差异 (Dissimilarities / Differences between and Virtual and Cache Memory)
Virtual Memory | Cache Memory |
---|---|
The term "virtual memory" refers to space allocated on a hard disk where data can be stored for fast access. | Cache memory is a small high-speed memory usually Static RAM (SRAM) that contains the most recently accessed pieces of main memory. |
Virtual memory enlarges the volume of RAM. | By using cache Access time consumed by the processor is less as compared to main memory. |
Operating system has the control over virtual memory. | Hardware has the control over cache memory. |
The size of virtual memory is more than cache memory. | The size of Cache memory is less than virtual memory. |
In virtual memory, larger programs can be executed while there is a sufficiently small amount of main memory. | The cache contains data items that are most frequently used by the processor while the whole program resides in the secondary memory. |
虚拟内存 | 高速缓存存储器 |
---|---|
术语“虚拟内存”是指在硬盘上分配的空间,可以在其中存储数据以进行快速访问。 | 高速缓存是一种小型高速存储器,通常为静态RAM(SRAM),其中包含最近访问的主存储器。 |
虚拟内存扩大了RAM的容量。 | 通过使用高速缓存,与主内存相比,处理器消耗的访问时间更少。 |
操作系统可以控制虚拟内存。 | 硬件可以控制缓存。 |
虚拟内存的大小大于缓存内存。 | 缓存内存的大小小于虚拟内存。 |
在虚拟内存中,可以在较大数量的主内存中执行较大的程序。 | 当整个程序驻留在辅助存储器中时,高速缓存包含处理器最常使用的数据项。 |
虚拟内存做缓存