Search code examples
windowscachingx86operating-systemcpu-cache

My OS reports 3.8GB cached, much more than reported from CPU-Z


This screen shot from cpu-z says my cpu cache is the following.

Cached reported by CPU-Z application

Now I see my cache my Task Manager saying 3.8 GB. Can someone explain how my CPU cached increase to 3.8 GB?

Cached display from Task Manager


Solution

  • Task manager is showing you how much RAM is being used to cache the hard disk(s). CPU-Z is showing you how much internal cache your CPU has to cache RAM.

    And within the CPU, there are again multiple levels of cache: Why is the size of L1 cache smaller than that of the L2 cache in most of the processors?.

    So when executing a program stored on disk, the layers of caching between the source of the machine code (disk) and the instruction-fetch pipeline stage in your CPU are:

    • "L0" uop cache. (I think you have a recent Intel CPU, based on the cache sizes).
    • L1I cache (and the iTLB to cache page tables)
    • L2 cache (private per-core)
    • L3 cache (shared between all cores)

    The above are built-in to your CPU's silicon chip


    • (optional) L4 eDRAM on some Broadwell/Skylake CPUs (inside the same physical package of your CPU, but on a separate silicon chip).

    The above are all caching RAM.


    • Your OS's disk cache, using RAM instead of re-reading from disk every time.
    • inside your hard drive: 16 to 128MiB of DRAM to buffer transfers between the SATA link and the platter, and to cache repeated access to the same sector in case the OS's disk cache didn't filter that out already. But its main purpose is a transfer buffer.

    All the same levels of cache would apply for reading a memory-mapped file (except it would be L1D cache, instead of uop cache + L1I).