[Paper Review] Nova: Safe Off-Heap Memory Allocation and Reclamation
This paper proposes DEBRA, a distributed epoch-based memory reclamation scheme for lock-free data structures that reduces synchronization overhead and prevents memory leaks due to crashed processes. By using signaling primitives and a novel neutralization technique, DEBRA+ ensures fault-tolerant reclamation with O(1) amortized cost per operation and up to 94% lower memory usage than DEBRA, outperforming hazard pointers by 70% on average.
In recent years, we begin to see Java-based systems embrace off-heap allocation for their big data demands. As of today, these system rely on simple ad-hoc garbage-collection solutions, which restrict the usage of off-heap data. This paper introduces the abstraction of safe off-heap memory allocation and reclamation (SOMAR), a thread-safe memory allocation and reclamation scheme for off-heap data in otherwise managed environments. SOMAR allows multi-threaded Java programs to use off-heap memory seamlessly. To realize this abstraction, we present Nova, Novel Off-heap Versioned Allocator, a lock-free SOMAR implementation. Our experiments show that Nova can be used to store off-heap data in Java data structures with better performance than ones managed by Java’s automatic GC. We further integrate Nova into the open-source Oak concurrent map library, which allows Oak to reclaim keys while the data structure is being accessed.
Motivation & Objective
- To address the critical challenge of safe memory reclamation in lock-free data structures, where traditional techniques like hazard pointers and epoch-based reclamation (EBR) suffer from high overhead or fault intolerance.
- To eliminate the risk of memory leaks caused by crashed or slow processes in epoch-based reclamation, which can block all memory reclamation indefinitely.
- To design a modular, composable abstraction—called the Record Manager—that decouples memory reclamation logic from data structure implementation with minimal performance cost.
- To achieve high performance and scalability across diverse workloads and thread counts, especially under high contention and NUMA architectures.
Proposed method
- Proposes DEBRA, a distributed variant of epoch-based reclamation (EBR) that uses system signaling (e.g., futexes on Linux) to coordinate epoch advancement across processes.
- Introduces a neutralization mechanism that allows processes to be effectively 'neutralized' when they are context-switched out, enabling continued memory reclamation even if some processes are inactive.
- Employs a Record Manager abstraction that enables runtime substitution of allocation, deallocation, and reclamation strategies with a single line of code, enhancing modularity and performance portability.
- Uses a bounded number of epoch counters and per-process epoch tracking to ensure that retired objects are reclaimed only when no active process can access them.
- Applies a two-phase reclamation protocol: first, objects are retired and marked for reclamation; second, they are freed only after all processes have passed through a safe epoch boundary.
- Employs a pooling strategy in some experiments to reduce system call overhead, demonstrating that the scheme remains efficient even with dynamic memory allocation.
Experimental results
Research questions
- RQ1Can epoch-based reclamation be made fault-tolerant in the presence of crashed or stalled processes without incurring excessive synchronization overhead?
- RQ2Is it possible to reduce the memory overhead of epoch-based reclamation, especially in systems with many processes, by limiting the number of objects waiting for reclamation?
- RQ3How can memory reclamation be decoupled from data structure logic to improve modularity and enable easy comparison of different reclamation strategies?
- RQ4What performance overhead does a new reclamation scheme incur across varying workloads, thread counts, and contention levels?
- RQ5Can a signaling-based approach outperform traditional hazard pointers and other non-automatic reclamation techniques in real-world lock-free data structures?
Key findings
- DEBRA+ reduces memory usage by an average of 94% compared to DEBRA by enabling continued reclamation after process crashes, with O(mn²) objects waiting to be freed, where n is the number of processes and m is a small constant.
- DEBRA+ outperforms a highly optimized hazard pointer implementation by an average of 70% across all workloads and thread counts.
- The Record Manager abstraction enables switching between different allocation, pooling, and reclamation strategies with a single line of code and incurs virtually no performance overhead.
- In experiments with a balanced binary search tree, DEBRA+ has only 10% average overhead compared to no reclamation, and up to 20% performance gain in some cases.
- On a 16-core system with 64 hardware contexts, DEBRA+ neutralizes processes an average of 935 times per trial, significantly reducing peak memory usage.
- The scheme achieves O(1) amortized cost per high-level operation and O(1) worst-case cost per object retirement, making it highly efficient for production use.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.