Topic domain
Memory Systems
Address spaces, allocators, and the cost of touching memory.
- Articles
- 80
- Clusters
- 8
- Foundational
- 24
- Intermediate
- 32
- Advanced
- 24
Paging, address translation, and page tables.
- Splitting a Virtual Address into Page Number and Offset
- Walking a Multi-Level Page Table
- The TLB, Associativity, and What a Miss Actually Costs
- Demand Paging and the First-Touch Fault
- Clock, Second Chance, and the Cost of Approximating LRU
- Large Pages: What 2 MiB Granularity Buys and What It Breaks
Allocators
10Arena, slab, and general-purpose heap design.
- Bump Allocation and the Cost of Arena Reset
- Boundary Tags and Coalescing in a Free-List Heap
- Size-Class Segregation and Fit Policy in the Heap
- Slab Caches and Per-CPU Magazines for Fixed-Size Objects
- Thread-Local Caches and the Cost of a Remote Free
- How free Recovers a Size From a Bare Pointer
Locality, coherence, and replacement.
- The Memory Gap and the Arithmetic of Average Access Time
- Set Associativity and the Address Bits a Cache Decodes
- Write-Back, Write-Through, and the Cost of a Dirty Line
- Replacement Without Exact LRU: Reference Bits and Clock Hands
- Stride Prefetchers and the Timing Problem of Prefetch Distance
- MESI Transitions and the Traffic an Invalidation Generates
Remote access costs and placement policy.
- Node Distance and the Real Cost of a Remote Memory Access
- Reading NUMA Topology from the SRAT and SLIT
- First-Touch Placement and the Faulting Thread
- CPU Affinity Masks and What Pinning Actually Costs
- Interleaving Pages Across Nodes for Aggregate Bandwidth
- Where a Memory Policy Attaches and How It Inherits
Bounds, use-after-free, and mitigation strategies.
- How an Out-of-Bounds Write Reaches Allocator Metadata
- Use-After-Free and the Reuse That Conceals It
- Stack Canaries and What They Actually Detect
- Double Free and the Integrity of Free Lists
- AddressSanitizer and the Arithmetic of Shadow Memory
- Slice Bounds Checks and the Conditions for Eliding Them
Durability semantics and crash consistency.
- A Completed Write Is Not Yet Durable: Persistence Domains and Ordering
- What fsync Actually Waits For, and Why the Directory Counts
- Cache Flushes and FUA: The Two Ordering Primitives Below the Filesystem
- Write-Ahead Logging and the Commit Record
- Checkpointing and the Cost of a Consistent Snapshot
- Shadow Paging and Copy-on-Write Trees
Formal models of reads, writes, and ordering.
- Sequential Consistency as the Reference Memory Model
- Store Buffers and the x86-TSO Model
- Happens-Before and the Definition of a Data Race
- Coherence and the Modification Order of a Single Location
- Release, Acquire, and the Synchronizes-With Edge
- The DRF-SC Guarantee and What It Buys a Programmer
Leak detection, fragmentation, and footprint analysis.
- Reading a Process Footprint: RSS, PSS, and Shared Pages
- Interposing on malloc: How Allocation Tracing Hooks a Heap
- Attributing Allocations to Call Sites by Unwinding the Stack
- Reachability, Retention, and What Counts as a Leak
- Allocator Metadata and the Real Cost of a Small Object
- Measuring Fragmentation: Free Space That Cannot Be Used
All Memory Systems articles
- Oct 14, 2026 Reachability, Retention, and What Counts as a Leak Why unreachable memory and unfreed memory are different problems, how a tracing collector decides an object is dead, and where conservative roots keep garbage alive.
- Oct 2, 2026 Ordering Stores to Persistent Memory: CLWB, SFENCE, and Failure Atomicity Which instruction makes a store reach the media, why a flush without a fence still allows reordering, and how a persistent heap builds transactions out of a cacheline flush and an undo log.
- Oct 2, 2026 Shadow Stacks and Protecting the Return Address Why a parallel copy of the return address catches overflows that canaries miss, how the check is wired into the epilogue, and what the hardware support changes.
- Sep 30, 2026 Litmus Tests as Executable Specifications How a five-line concurrency test becomes a machine-checkable claim, what the litmus file format encodes, and how a model checker decides which outcomes are forbidden.
- Sep 30, 2026 Measuring Fragmentation: Free Space That Cannot Be Used How internal and external fragmentation differ, why a heap can be mostly free and still fail a large request, and which ratios turn free space into a number that predicts allocation failure.
- Sep 16, 2026 Checkpointing and the Cost of a Consistent Snapshot Why capturing a consistent image of a mutating data structure requires either a pause or a write barrier, and how copy-on-write roots, double buffering, and fuzzy checkpoints differ in cost.
- Sep 14, 2026 Capability Machines and the CHERI Bounds Encoding How a pointer that carries its own bounds and permissions replaces a flat address space, what the compressed bounds cost in bits, and why the model makes spatial safety a hardware property.
- Sep 11, 2026 Slice Bounds Checks and the Conditions for Eliding Them How a length-carrying descriptor makes every index a checked operation, what the branch costs when it is not removable, and which static facts let a compiler prove it away.
- Aug 26, 2026 Write-Back, Write-Through, and the Cost of a Dirty Line How a cache decides whether a store waits for memory, what write-allocate does to a partial line, and why the dirty bit turns an eviction into a second transaction.
- Aug 24, 2026 First-Touch Placement and the Faulting Thread Why a page lands on the node of whichever thread first writes it, what the kernel actually does inside the fault handler, and how the choice of allocation policy changes that default.
- Aug 21, 2026 Reading a Process Footprint: RSS, PSS, and Shared Pages Why resident set size double-counts shared pages, how proportional set size divides them between users, and which memory a process consumes that no per-process counter attributes to it.
- Aug 13, 2026 Bump Allocation and the Cost of Arena Reset Why a pointer-increment allocator can serve thousands of requests in a few cycles, what alignment bookkeeping it still needs, and the ownership rule that makes wholesale reset safe.
- Aug 12, 2026 Verifying Crash Consistency with Fault Injection Why a crash-consistency claim needs an exhaustive state-space argument rather than a test, how to model a device that loses writes and reorders them, and which failures the method cannot find.
- Aug 11, 2026 Demand Paging and the First-Touch Fault What happens between mmap returning and a page becoming resident, the three fault outcomes a handler must distinguish, and why anonymous memory is zeroed lazily.
- Jul 15, 2026 Footprint Under a Container Limit: Reclaim, Working Set, and the OOM Decision How a memory cgroup accounts page cache and anonymous memory, why a process at its limit keeps running while a slightly larger one is killed, and how to read the counters that separate reclaimable from unreclaimable.
- Jul 10, 2026 Double Free and the Integrity of Free Lists What the allocator does with a second release of the same block, why the list structure makes it dangerous, and how per-thread caches and consistency checks contain it.
- Jun 24, 2026 Interposing on malloc: How Allocation Tracing Hooks a Heap How a tracing layer replaces malloc and free without editing the program, why the replacement must not call the functions it replaces, and which allocations escape interposition entirely.
- Jun 22, 2026 CPU Affinity Masks and What Pinning Actually Costs How a task affinity mask restricts the scheduler, why pinning a thread can lower latency and raise queueing at the same time, and what the load balancer does when every task is pinned.
- Jun 2, 2026 Interleaving Pages Across Nodes for Aggregate Bandwidth Why spreading a range round-robin over every node raises streaming throughput and raises pointer-chasing latency, how the interleave sequence is kept, and when the policy is worth its cost.
- May 25, 2026 Size-Class Segregation and Fit Policy in the Heap Why bucketing free blocks by size turns an unbounded search into a bounded one, how rounding requests up to a class wastes memory, and how fit policy interacts with fragmentation.
- May 14, 2026 Slab Caches and Per-CPU Magazines for Fixed-Size Objects How object caches amortise construction and keep hot free objects in per-CPU lists, why the magazine layer exists, and when an empty slab can be returned to the page allocator.
- May 13, 2026 Boundary Tags and Coalescing in a Free-List Heap How a heap finds the neighbours of a freed block using headers at both ends, why coalescing is necessary for reuse, and what the deferred variants cost in latency.
- May 8, 2026 Splitting Footprint by Mapping Type: Anonymous, File-Backed, and Special How a process address space divides into anonymous, file-backed, and special mappings, what each contributes to footprint, and how to read the permission and label fields that identify them.
- Apr 21, 2026 Heap Growth and Release: brk, mmap, and Trim How a process obtains heap memory from the kernel, why a large allocation bypasses the main heap entirely, and what returning pages actually costs at the page-table level.
- Apr 9, 2026 Miss Status Holding Registers and Memory-Level Parallelism How a cache tracks outstanding misses by line rather than by request, why secondary misses merge, and how the number of MSHRs caps the parallelism a core can expose.
- Apr 7, 2026 AddressSanitizer and the Arithmetic of Shadow Memory How a one-eighth-scale shadow map turns every load and store into a validity query, what the poison values encode, and where the scheme cannot see.
- Mar 21, 2026 Shadow Paging and Copy-on-Write Trees How writing a modified page to a new location instead of in place makes every update atomic, what the pointer-update protocol must flush, and how the space cost accumulates until a collection pass reclaims it.
- Mar 19, 2026 Where a Memory Policy Attaches and How It Inherits Policies belong to address ranges and to tasks, not to allocations, and the two interact at every fault; how splitting, forking, and exec change which policy is in force.
- Mar 17, 2026 Attributing Allocations to Call Sites by Unwinding the Stack How a tracing allocator recovers the calling stack for each allocation, why frame-pointer chains fail in optimised code, and what a table-driven unwind costs per event.
- Mar 16, 2026 Coherence and the Modification Order of a Single Location The four coherence axioms, why per-location agreement is much weaker than a global order, and how IRIW separates the two.
- Feb 17, 2026 Partitioning a Workload So Every Thread Reads Local Memory How to divide data and threads so that each partition lives on the node that processes it, what the boundaries between partitions cost, and where the design breaks on machines with uneven node counts.
- Feb 1, 2026 Nested Paging: Two-Dimensional Translation for Virtual Machines How a guest physical address becomes a host physical address, why the walk cost multiplies, and which workloads suffer most from the second level of tables.
- Jan 24, 2026 Hardened Allocators and Metadata Integrity How allocator metadata becomes an attack surface, what canaries, quarantines, and out-of-band tables actually detect, and the performance each check costs.
- Jan 14, 2026 A Completed Write Is Not Yet Durable: Persistence Domains and Ordering Why write and close return long before bytes reach media, how a persistence domain decides what a crash can lose, and why durability, ordering, and atomicity need separate mechanisms.
- Jan 8, 2026 What fsync Actually Waits For, and Why the Directory Counts The difference between fsync, fdatasync, and syncfs, why a durable file can still vanish after a crash, and what rename-based update protocols must flush to be correct.
- Dec 15, 2025 Allocator Metadata and the Real Cost of a Small Object What a heap spends on headers, free-list links, alignment padding, and page maps, and how to compute the ratio between bytes requested and bytes the process actually pays for.
- Dec 4, 2025 Use-After-Free and the Reuse That Conceals It What a dangling pointer actually refers to after the object dies, why an immediate reuse so often makes the bug invisible, and how quarantine and poisoning change the diagnosis.
- Nov 30, 2025 Large Pages: What 2 MiB Granularity Buys and What It Breaks How huge pages collapse page-table levels and extend translation reach, why physical contiguity is the binding constraint, and where the memory waste becomes unacceptable.
- Nov 20, 2025 Release, Acquire, and the Synchronizes-With Edge What an acquire load is forbidden to move above, what a release store is forbidden to move below, and why the edge is directional rather than a barrier.
- Nov 10, 2025 Write-Ahead Logging and the Commit Record How a log turns many scattered writes into one ordered append, what makes a commit record valid, and why replay must be idempotent to survive a crash during recovery.
- Nov 4, 2025 Walking a Multi-Level Page Table How four levels of tables turn a 36-bit page number into a frame, what each level costs in memory and cache misses, and why the walk is not free even when it succeeds.
- Oct 10, 2025 Fragmentation Without Leaks: Diagnosing a Growing Heap Why a process whose live set is flat can still grow, how internal and external fragmentation differ in cause and cure, and which counters distinguish the two.
- Sep 11, 2025 The DRF-SC Guarantee and What It Buys a Programmer Why race-free programs are sequentially consistent on hardware that is not, and the composition rules that let this promise survive layers of abstraction.
- Aug 26, 2025 Clock, Second Chance, and the Cost of Approximating LRU How a reference bit turns a circular scan into a cheap replacement policy, what the scan rate reveals about memory pressure, and where the approximation breaks down.
- Aug 17, 2025 Inclusive, Exclusive, and Non-Inclusive Last-Level Caches What the inclusion property buys the coherence protocol, why a back-invalidation hurts an inclusive L2, and how a non-inclusive design changes where the snoop filter lives.
- Aug 17, 2025 Splitting a Virtual Address into Page Number and Offset Why translation happens at page granularity, how the address bits divide between frame number and offset, and what that division costs in fragmentation and alignment.
- Aug 15, 2025 Reading NUMA Topology from the SRAT and SLIT What the two ACPI tables describe, how a proximity domain is enumerated from the static resource affinity table, and why the locality distance table is only an ordering.
- Jul 31, 2025 Reverse Mapping: Finding Every Page Table That Points at a Frame Why the kernel needs to go from a physical frame back to its mappings, how the reverse index is built and maintained, and what it costs in memory and lock contention.
- Jul 28, 2025 Page Migration: What a Move Between Nodes Costs How the kernel relocates a populated page from one node to another, why the operation needs to unmap every mapping first, and the conditions under which a requested migration silently does nothing.
- Jul 4, 2025 Alignment, Padding, and Over-Aligned Allocation What the alignment guarantee on a returned pointer actually promises, how allocators satisfy requests stronger than the ABI default, and why page-granular requests behave differently.
- Jun 24, 2025 Measuring Remote Access with Hardware Counters Which performance events distinguish a local from a remote memory access, why per-node counters answer a different question than per-process ones, and how the two are combined to find misplaced data.
- Jun 16, 2025 Memory-Mapped Persistence: What msync and DAX Actually Guarantee How a shared mapping becomes durable, why msync is not fsync, what direct access bypasses the page cache, and where the mapping and the filesystem metadata disagree after a crash.
- May 27, 2025 Dependencies, RCsc, and RCpc Acquire on ARMv8 How address and data dependencies order accesses without a barrier, and why ARMv8.3 added a second, cheaper form of acquire load alongside the original one.
- May 21, 2025 Sequential Consistency as the Reference Memory Model Lamport's two conditions, the executions they exclude, and why every weaker model is described by which of those exclusions it gives up.
- May 7, 2025 Stride Prefetchers and the Timing Problem of Prefetch Distance How a stream prefetcher detects a recurring address delta, why prefetching too early evicts useful lines, and how accuracy, coverage, and timeliness trade against each other.
- May 6, 2025 The TLB, Associativity, and What a Miss Actually Costs How the translation cache is organised, why it is small and fully associative, what the hardware does on a miss, and which access patterns destroy its hit rate.
- May 5, 2025 How an Out-of-Bounds Write Reaches Allocator Metadata Why the bytes just past a heap object belong to the allocator, how a single byte can turn a length field into an address, and which layouts keep bookkeeping out of the blast radius.
- Apr 12, 2025 Cacheability, Write-Combining, and Mapping Device Memory How page attributes control caching for MMIO and DMA, what happens when a load is speculatively reordered past a device write, and why the mapping must be uncached.
- Apr 10, 2025 The Linux Kernel Memory Model and Its Tooling How LKMM formalises READ_ONCE, smp_mb, and RCU into an executable model, what its relation set adds to the architecture models, and where it deliberately diverges from C11.
- Apr 4, 2025 Torn Writes, Sector Atomicity, and the RAID Write Hole Why a 512-byte sector write is atomic but a 4 KiB write may not be, how torn writes corrupt filesystems that assume otherwise, and what parity updates do to crash consistency.
- Dec 7, 2024 Thread-Local Caches and the Cost of a Remote Free Why per-thread free lists remove contention from malloc, what a free on the wrong thread must do, and how ownership transfer and rebalancing keep the design from stranding memory.
- Nov 5, 2024 Replacement Without Exact LRU: Reference Bits and Clock Hands Why a cache cannot maintain a true LRU stack at speed, how one reference bit per line and a rotating hand approximate it, and where the approximation picks the wrong victim.
- Nov 1, 2024 Causality and Out-of-Thin-Air Values in the Java Model Why the Java Memory Model needed a causality order rather than happens-before alone, and how the happens-before consistency rules leave room for a value with no writer.
- Oct 26, 2024 Stack Canaries and What They Actually Detect How a random guard word between local buffers and saved control data turns a linear stack overflow into a detectable event, and which overflows it cannot see.
- Oct 24, 2024 Set Associativity and the Address Bits a Cache Decodes How a physical address splits into tag, index, and offset, why direct-mapped and fully associative arrays are the two ends of one trade, and what conflict misses actually cost.
- Sep 13, 2024 Cache Flushes and FUA: The Two Ordering Primitives Below the Filesystem How a flush drains a volatile device cache, how forced unit access bypasses it for a single write, and why both are required to build a write barrier out of a queue that reorders.
- Sep 9, 2024 The Memory Gap and the Arithmetic of Average Access Time How the latency of each level combines into one average, why a small miss rate can dominate the total time, and where the model stops describing real hardware.
- Aug 13, 2024 MESI Transitions and the Traffic an Invalidation Generates What each coherence state permits, which transactions move a line between them, and why a false sharing pattern produces more bus traffic than the data it writes.
- Jul 22, 2024 Ownership and Borrowing as a Static Lifetime Proof How move semantics, exclusive borrows, and non-lexical lifetimes let a compiler prove that no pointer outlives its referent, and where the proof stops being able to help.
- Jul 5, 2024 Memory Tagging and the Granule Trade-Off How a tag in the pointer and a tag in memory turn a stale or out-of-bounds access into a fault, why the granule size decides which bugs are visible, and what probabilistic checking buys.
- Jun 28, 2024 Store Buffers and the x86-TSO Model How a per-core write buffer leaves store-load as the only program-order pair that may invert, why forbidding it would defeat the buffer, and what a locked instruction orders.
- May 25, 2024 Kernel Page Table Isolation and What It Costs on Every Trap Why splitting the kernel into a separate address space defends against speculative reads, how the switch is arranged to be nearly free, and where the remaining cost lands.
- Apr 17, 2024 Virtually Indexed Caches and the Page Coloring Problem Why a cache can start its lookup from a virtual address and finish with a physical tag, when that creates synonyms, and how page coloring controls which sets a process occupies.
- Apr 3, 2024 Detecting Slow Growth in a Long-Running Process How to separate a genuine slow leak from allocator sawtooth and from legitimate growth, using slope estimation, idle baselines, and live-set accounting rather than a single threshold.
- Feb 2, 2024 Automatic NUMA Balancing and Its Failure Modes How the kernel samples faults to discover which node a task is really using, moves pages toward the task, and why the mechanism sometimes makes a workload slower than leaving it alone.
- Jan 20, 2024 Re-Reference Interval Prediction in Shared Last-Level Caches How a two-bit prediction value per line resists scan thrashing, why set dueling picks a policy without simulating every access, and where shared-cache insertion policy goes wrong.
- Sep 26, 2023 How free Recovers a Size From a Bare Pointer The address arithmetic that turns a returned pointer back into its block header, the alignment assumptions that make it work, and the cases where the original base cannot be reconstructed.
- Jan 12, 2023 Sampling Allocation Profilers and the Statistics of Estimates How a profiler that records one allocation in a few thousand still reports accurate totals, why the sampling must be size-weighted, and how the confidence interval is computed.
- Mar 18, 2022 Happens-Before and the Definition of a Data Race How sequenced-before and synchronizes-with compose into a partial order, why a race is a pair of unordered conflicting accesses, and what the standard does once one exists.
- Feb 15, 2022 Node Distance and the Real Cost of a Remote Memory Access How a cache-coherent link turns an ordinary load into a transaction between two sockets, why distance values are ranks rather than nanoseconds, and which resource a remote access actually consumes.