An Active Memory Working Set

A working set approximates which memory regions a program will actively reuse over a chosen observation interval.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace two phases
  2. Read an effect on execution
  3. Count what a program repeatedly touches in an interval
  4. Connect locality to a specific performance question

Trace two phases

A first phase scans one buffer repeatedly and then switches to another. Recent access history changes with the phase, even if both allocations remain live. Retained memory describes a different quantity.

Read an effect on execution

If the active region fits in fast memory, reuse can reduce storage wait. If important pages repeatedly leave before reuse, performance can suffer. See working sets and thrashing.[1]

Count what a program repeatedly touches in an interval

A process can map a large table while repeatedly consulting only ten recently popular pages. Memory reserved for address space and pages actively referenced during the interval are different measurements. If the access pattern expands, the working set can grow. See memory pages and offsets.

Virtual region: 10,000 pages
Interval A touches pages 1 through 10
Interval B repeatedly touches 1,000 pages
Observed working set depends on interval and access behavior

Connect locality to a specific performance question

Memory pressure can evict pages needed soon and cause repeated faults. Measure the pages touched by the workload during the relevant interval. Compare sequential streaming with repeated random access.

References

  1. Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau, Operating Systems: Three Easy Pieces ↩