Custom Search

Cache Memory

Cache is a block of memory that is used for temporary storage of data. The data that is put into cache is sata that is likely to be used again by the program.

CPUs and hard drives frequently use a cache, as do web browsers and web servers.

A cache is made up of data elements that are already stored in memory. Each data entry has a tag, which specifies the identity of the datum in the backing store of which the entry is a copy.

When the cache client (the user of the cache - a CPU, web browser, operating system etc.) needs to access data it first checks the cache as this is quicker to access. If it finds the data in the cache the situation is known as a cache hit.

For example, a web browser program might check its local cache on disk to see if it has a local copy of the contents of a web page at a particular URL. The URL is the tag, and the contents of the web page is the item of data stored in the cache.

The percentage of accesses that result in cache hits is known as the hit rate or hit ratio of the cache.

If the cache is consulted and the desired tag is not found we have a cache miss. When this happens the data item is obtained from memory for the client and a copy is also placed in the cache, ready for the next access.

The system employs a ' replacement policy' for filling the cache. "Least recently used" (LRU), replaces the least recently used entry. More efficient caches compute use frequency against the size of the stored contents, as well as the latencies and throughputs for both the cache and the backing store. This works well for larger amounts of data, longer latencies and slower throughputs, such as those experienced with a hard drive and the Internet, but is not efficient for use with a CPU cache.