cache
Pronounced "cash." A special area of memory, managed by a cache controller, that improves performance by storing the contents of frequently accessed memory locations and their addresses.
A memory cache and a disk cache are not the same. A memory cache is implemented in hardware and speeds up access to memory. A disk cache is software that improves hard-disk performance.
When the processor references a memory address, the cache checks to see if it holds that address. If it does, the information is passed directly to the processor, so RAM access is not necessary. A cache can speed up operations in a computer whose RAM access is slow compared with its processor speed, because cache memory is always faster than normal RAM.
There are several types of caches:
-
Direct-mapped cache A location in the cache corresponds to several specific locations in memory, so when the processor calls for certain data, the cache can locate it quickly. However, since several blocks in RAM correspond to that same location in the cache, the cache may spend its time refreshing itself and calling main memory.
-
Fully associative cache Information from RAM may be placed in any free blocks in the cache so that the most recently accessed data is usually present; however, the search to find that information may be slow because the cache has to index the data in order to find it.
-
Set-associative cache Information from RAM is kept in sets, and these sets may have multiple locations, each holding a block of data; each block may be in any of the sets, but it will only be in one location within that set. Search time is shortened, and frequently used data are less likely to be overwritten. A set-associative cache may use two, four, or eight sets.
See also disk cache; wait state; write-back cache; write-through cache.