Drainability: When Coarse-Grained Memory Reclamation Produces Bounded Retention

Read full text
Authors: Dayna Blackwell
Cited by: 0

Abstract

Long-running services built on coarse-grained, non-relocating memory allocators face a fundamental question: under what conditions is memory retention bounded? This paper defines drainability as a structural property of allocation lifetimes relative to the lifecycle of the granule to which they are routed, and proves that it is the necessary and sufficient condition for bounded retention in these systems. We establish a sharp dichotomy: when the routing function aligns allocation lifetimes with granule reclaim boundaries (drainability satisfied), retained memory is bounded by a constant independent of total allocation volume, request count, or uptime. When it does not (drainability violated), retained memory grows at least linearly. There is no intermediate asymptotic regime. This yields a precise distinction between logical leaks (an allocation is never freed) and structural leaks (all allocations are freed, but lifetime-granularity misalignment prevents granules from draining), a failure class that is invisible to conventional leak detectors like Valgrind. We validate both results empirically, observing a 238x recycle-rate differential under identical allocator logic, differing only in allocation routing.

Fields of Study & Subjects

Logic programming and type systems Parallel Computing and Optimization Techniques Software System Performance and Reliability

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
16 February 2026
Language
EN
Document type
Preprint