AlgoViz

Caches, NUMA and memory locality

medium 7 min

A cache line is the unit moved between CPU caches.

Where it shows up

The same pattern appears across everyday software.

  • A worker moves away from its data

    After a placement change a worker spends longer waiting on loads although total CPU use looks similar. Compare local and remote allocations alongside the CPUs where the threads actually run. Moving a thread leaves its already allocated pages behind. Changing placement before the hot pages are first touched can keep both together.

  • Verifying the intervention

    Coordinate CPU and first-touch placement, then remeasure using an equal-sized working set. If page placement is local, look for false sharing and memory bandwidth saturation before moving the process again.