tree: 2bb328327e491b76dd9d0c84fcaba5a091067f26 [path history] [tgz]
  1. init/
  2. src/
  3. tools/
  5. Cargo.lock
  6. Cargo.toml

Fine-grained collection of memory stats

Warning: This document is old & has moved. Please update any links:

The Chromium OS memory daemon (memd) is a lightweight collector of values and events related to system memory.

Memd runs continuously, but is mostly asleep when memory pressure is low. As pressure increases, it starts sampling rapidly various kernel-supplied quantities, mainly from /proc/vmstat. It also collects events, such as the crossing of the available memory threshold which produces a low-memory notification.

The sampling and event collection is done in an in-memory circular buffer. Certain “interesting” events trigger a collection, that is make memd dump a range of samples and events around the interesting events into a clip file in /var/log/memd. Clip files are also rotated, and the older ones get eventually clobbered by new events.

The intent is that memd output be collected alongside the rest of the logs collected with feedback reports. If the report was motivated by poor behavior of the memory subsystem, the data will be directly useful. Otherwise the data can be opportunistically used for analysis.