TL;DR
MaxMem is a lightweight, user-space memory management system designed to handle the complexities of tiered main memory (e.g., DRAM combined with slower, high-capacity NVM or CXL). By using "fast-memory miss ratios" (FMMR) as a primary metric, it dynamically ensures Quality of Service (QoS) for colocated Big Data applications, delivering up to 38% better throughput and an order of magnitude lower tail latency than existing Linux defaults.
What Problem Does This Paper Address?
Modern Big Data applications are memory-hungry, often requiring terabytes of space. While tiered memory systems—which pair a small amount of fast DRAM with a large amount of "slow" memory like Intel Optane or CXL-attached modules—offer a cost-effective solution, managing them is a nightmare.
Existing systems usually fall into three traps:
- Static Partitioning: They divide memory once, failing to adapt when an application’s workload changes.
- High Overhead: They rely on heavy kernel-level page faulting or scanning, which eats into the very performance they try to save.
- Poor Colocation: When multiple apps share the same server, "best-effort" tasks often steal fast memory from "latency-sensitive" ones, leading to unpredictable performance spikes.
MaxMem aims to maximize application colocation (running many apps on one server) while guaranteeing that high-priority apps get the fast memory they need to meet performance targets.
Methods
MaxMem moves memory management out of the complex Linux kernel and into user-space. It consists of two main parts: a central manager daemon and a lightweight library (libMaxMem) linked into the applications.
Key technical innovations include:
- FMMR-based QoS: Instead of just looking at capacity, MaxMem looks at the Fast-Memory Miss Ratio—the percentage of memory accesses that "miss" DRAM and hit the slow tier. Users set a target FMMR (e.g., 0.1), and MaxMem adjusts DRAM allocation to hit that goal.
- Heat Gradient Binning: MaxMem uses Intel PEBS (Processor Event Based Sampling) to "sniff" memory traffic. It bins pages into six "hotness" categories based on access frequency. This allows it to identify exactly which pages will give the biggest performance boost if moved to DRAM.
- Dynamic Reallocation: Every "epoch" (usually 1 second), the system calculates which apps have surplus fast memory and which are "starving," then migrates pages accordingly.
- Userfaultfd: It leverages the Linux
userfaultfdmechanism to handle page faults in user-space with negligible overhead, allowing it to intercept memory allocations without kernel modifications.
Datasets
The authors evaluated MaxMem using a suite of representative Big Data and high-performance computing workloads:
- FlexKVS: A high-performance, latency-sensitive key-value store.
- GUPS (Giga Updates Per Second): A microbenchmark used to stress memory bandwidth and latency.
- GapBS: A graph processing suite (specifically the Betweenness Centrality algorithm).
- NAS BT: A parallel benchmark from the NAS Parallel Benchmarks suite (Block Tri-diagonal solver).
The evaluation was performed on a server equipped with 192 GB of DDR4 DRAM and 768 GB of Intel Optane DC Persistent Memory.
Key Insights and Ideas
- FMMR is the "Magic Metric": The authors argue that miss ratios are a better proxy for performance than raw memory size. Because miss curves are not known a-priori, a system must reactively tune the ratio rather than just assigning a fixed GB limit.
- User-Space is Sufficient: Traditionally, developers thought memory tiering had to be in the kernel for speed. MaxMem proves that with modern features like PEBS and
userfaultfd, a user-space manager is not only faster to develop but also highly performant. - The "Cooling" Mechanism: To handle shifting workloads, MaxMem "cools" its hotness bins by halving access counts periodically. This prevents "zombie" hot pages (pages that were hot ten minutes ago but are now idle) from hogging precious DRAM.
Key Results
In dynamic scenarios where multiple applications were competing for resources:
- Throughput: MaxMem provided 11% better throughput than HeMem (a state-of-the-art static manager) and 38% better than Linux AutoNUMA.
- Tail Latency: For the FlexKVS key-value store, MaxMem reduced 99th percentile latency by 80% compared to HeMem and by an order of magnitude compared to AutoNUMA.
- Efficiency: MaxMem achieved the same performance as static partitioning while using 32% less fast memory on average, because it could dynamically shift DRAM to the apps that needed it most at any given second.
Limitations and Future Work
- Security and Abuse: The authors note that a malicious application could "game" the system by intentionally touching pages to appear "hotter" than they are, potentially starving other apps. They suggest system administrators set explicit limits to mitigate this.
- NVM Specifics: The current prototype treats all "slow" memory tiers generally. It does not yet specifically optimize for the unique read/write asymmetry of technologies like Optane.
- Kernel Cooperative Remapping: Currently, the system requires a small amount of cooperation from the
libMaxMemlibrary to remap memory addresses. Future versions ofuserfaultfdmight allow the central manager to handle this entirely transparently. - CXL Integration: While tested on Optane, the authors expect the results to generalize to CXL-attached memory, which is becoming the industry standard for disaggregated memory.
Summary updated