---
title: "Transparent memory offloading: more memory at a fraction of the cost and power"
description: "TMO offloads cold memory to compressed RAM (zswap) or NVMe SSD swap."
url: "https://swe.quest/articles/transparent-memory-offloading-more-memory-at-a-fraction-of-the-cost-and-power-9a77f7c0bbbc4e59"
canonical: "https://engineering.fb.com/2022/06/20/data-infrastructure/transparent-memory-offloading-more-memory-at-a-fraction-of-the-cost-and-power/"
source: "Meta Engineering"
published: "2022-06-20"
difficulty: "hard"
kind: "Case study"
reading_minutes: 11
tags: ["linux","memory-management","operating-systems","cost-optimization","storage-systems"]
---

# Transparent memory offloading: more memory at a fraction of the cost and power

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2022-06-20, 11 min read, Case study. Original: [https://engineering.fb.com/2022/06/20/data-infrastructure/transparent-memory-offloading-more-memory-at-a-fraction-of-the-cost-and-power/](https://engineering.fb.com/2022/06/20/data-infrastructure/transparent-memory-offloading-more-memory-at-a-fraction-of-the-cost-and-power/)

## Summary

TMO offloads cold memory to compressed RAM (zswap) or NVMe SSD swap. It uses the kernel's Pressure Stall Information (PSI), which measures time lost to CPU, memory and I/O shortage, and a userspace agent, Senpai, that applies mild proactive reclaim through a new stateless cgroup2 memory.reclaim knob. A reworked Linux swap algorithm engages swap in proportion to file-cache refaults, so cold anonymous pages get evicted at low pressure instead of only near OOM. In production across millions of servers, TMO saves 20–32% of memory per server, and SSD backends suit poorly compressible data like quantized ads models.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Memory management](https://swe.quest/tags/memory-management.md) (Compilers & runtimes)
- [Operating systems](https://swe.quest/tags/operating-systems.md) (Infrastructure)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)

## Prerequisites

- Linux virtual memory and swap ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- cgroup2 memory controller
- page cache vs anonymous memory ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))

## Keywords

TMO, Pressure Stall Information, Senpai, cgroup2, zswap, NVMe SSD, CXL

## Related posts

- [Scaling Kubernetes Workloads with Node Swap](https://swe.quest/articles/scaling-kubernetes-workloads-with-node-swap-f795d2bfe3f76482.md): Kubernetes Blog · 2026-10-05 · Medium · 6 min read · Kubernetes, Linux, Sandboxing & isolation, Performance engineering, Cost optimization
  Kubernetes node swap, GA since v1.34 and backed by fast NVMe Local SSDs, lets nodes page out dormant anonymous memory and pack far more pods.
- [A case for QLC SSDs in the data center](https://swe.quest/articles/a-case-for-qlc-ssds-in-the-data-center-15a5d65a93f5feee.md): Meta Engineering · 2025-03-04 · Easy · 5 min read · Storage systems, Hardware, Datacenters, Cost optimization
  QLC flash can form a storage tier between HDDs, whose bandwidth per TB keeps falling as density grows, and TLC SSDs, which remain too costly to scale.
- [The effect of switching to TCMalloc on RocksDB memory use](https://swe.quest/articles/the-effect-of-switching-to-tcmalloc-on-rocksdb-memory-use-97e46a9ddc75be5e.md): Cloudflare · 2021-02-03 · Medium · 8 min read · Memory management, Performance engineering, Linux, Storage engines
  Quicksilver's memory roughly doubled after its storage moved to RocksDB, climbing from about 15GB to 30GB over several days.
- [Improving Lakebase Postgres Compute Cache on Neon, Part 1](https://swe.quest/articles/improving-lakebase-postgres-compute-cache-on-neon-part-1-96696f73ade727a0.md): Neon · 2026-09-09 · Hard · 9 min read · PostgreSQL, Caching, Performance engineering, Memory management, Virtualization
  On large fixed-size Lakebase Postgres computes, Neon now disables its NVMe-backed local file cache and sets shared buffers to 75% of DRAM (up from a 1 GB cap), backed by explicit 2 MB HugeTLB pages provisioned through host, hypervisor and guest VM.
- [Mastering Long Contexts in LLMs with KVPress](https://swe.quest/articles/mastering-long-contexts-in-llms-with-kvpress-778c6dc9287ed60d.md): Hugging Face · 2025-01-23 · Medium · 7 min read · Inference & serving, LLMs, Python, Performance engineering
  KV cache memory grows linearly with context length: Llama 3-70B at 1M tokens in bfloat16 needs about 330GB of KV cache, roughly 70% of total memory.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
