Skip to main content

Home L2 cache

L2 cache

(also Level 2 Cache, Secondary Cache)

L2 cache definition

L2 cache, is a type of static RAM memory used by the central processing unit. It stores frequently used data and instructions. The purpose of caches is to speed up data access for the CPU by avoiding the slower RAM memory accesses. The L2 cache sits between the faster L1 cache and the slower main memory.

When the CPU needs to access data, it first checks if the data is in its caches — it starts from L1, then L2, and so on. If the CPU finds that information in a cache, it won’t need to access the slower main memory. If the data is not found, the CPU moves to the next level in the memory hierarchy.

See also: memory cache, random access memory

Memory hierarchy in modern computer systems:

  • Register: The smallest and fastest type of cache inside the CPU core.
  • L1 Cache. This cache is also located inside the CPU core. It’s split into two sections: one for data (D-cache) and another for instructions (I-cache). It's the first level of cache that the CPU checks when it needs data.
  • L2 Cache. This is the next level of cache. In many modern processors, L2 cache is dedicated to a particular CPU core. It's slower than L1 cache but larger in size.
  • L3 Cache. This is a larger cache often shared among all the cores in a CPU. It's slower than L2 but faster than accessing the main memory.
  • Main Memory (RAM). This is the primary storage used by the CPU to store active data and programs. It's much slower compared to the caches but offers much larger storage capacity.