Memory organization and cache management



In computer systems, caches are used to diminish the slowness of main memory which is larger and cheaper than cache memory. Caches are faster because not far from CPU and not as large as main memory. In modern computers, there may be more than one cache memory. The layers composed a memory hierarchy.








The memory hierarchy is sometimes called an illusion to processors because a processor can have as large and fast a memory as it needs at the level of reasonable cost. In short, from a broader perspective it is easy to understand why memory hierarchies are needed; however, to understand how it works you need to narrow the perspective, e.g. taking account only two memory layers at one time.

Key concepts are:
  • cache miss and hit ratios.
  • memory and cache and average access speed
  • memory size, cache size
  • block or cache line size set size
  • direct mapping, fully associative mapping, set associative mapping
  • address partitioning (tag bits, index/set bits, block bits)
  • replacement algorithms such as LRU and random

On the internet, there are a lot of successful resources trying to explain how memory hierarchy works. I will share some of them I came crossed.

by Luis Ceze fromWashington University. (from the video 8.1 to 8.6th)



For memory mapping techniques, the following videos will be helpful:

Comments

Popular posts from this blog

Migrating from PHP to Python

(DRAFT) Scaling a django project using celery and elasticsearch