Persistent NVRAM Allocator for Crash-Safe Memory Recovery
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In systems using non-volatile RAM (NVRAM), existing technologies face challenges in managing memory mapping and CPU cache loss during crashes, leading to data inconsistency and memory leaks, which are critical issues in maintaining database uptime and integrity.
Innovation Solution
A specialized memory management system with a persistent and crash-safe allocator for NVRAM is implemented, utilizing a memory organization scheme that pre-allocates memory blocks and employs persistent mapping to track data, along with a recovery procedure to prevent memory leaks and data inconsistency, and a simulation method to test crash safety.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If existing memory management technologies are used in NVRAM systems, then general compatibility is maintained, but data inconsistency and memory leaks occur during crashes
Solution Approach 1:
The NVRAM is divided into distinct segments: a persistent allocator segment that stores allocation metadata and state information, and data segments for user applications. This segmentation allows the allocator to maintain crash-safe state independently from application data, preventing data inconsistency while keeping the memory management structure organized and manageable.
Solution Approach 2:
The persistent allocator performs preliminary actions by pre-establishing a structured memory organization with dedicated segments for allocation tracking before any crash can occur. The allocator maintains a persistent state in NVRAM that records all allocation decisions, ensuring that even if a crash occurs during allocation, the state can be recovered without inconsistency or leaks.
2Reliability
If traditional memory allocators are used, then simplicity is maintained, but memory leaks and data inconsistency occur during system crashes
Solution Approach 1:
The persistent allocator implements a nested structure where allocation metadata and state information are embedded within dedicated NVRAM segments. Each allocation operation nests its state information within the persistent allocator's segment, creating a hierarchical organization that ensures crash safety while maintaining a manageable complexity through structured nesting rather than scattered management.
Solution Approach 2:
The persistent allocator creates and maintains copies of allocation state information in NVRAM. When memory is allocated, the allocator's state (including allocation maps and metadata) is persisted to NVRAM, creating a recoverable copy that survives crashes. This copying mechanism ensures crash safety by preserving the allocation state independently of volatile memory.
3Reliability
If NVRAM is used for data storage, then data persistence is improved, but memory mapping loss and CPU cache loss during crashes cause data inconsistency
Solution Approach 1:
The system segments NVRAM into a persistent allocator segment that stores memory mapping information and allocation state, separate from data segments. This segmentation ensures that memory mapping information is persisted alongside data, preventing mapping loss during crashes. The allocator segment acts as a persistent record that reconstructs the memory layout after crashes, maintaining data consistency.
Solution Approach 2:
The persistent allocator acts as an intermediary between the CPU cache and NVRAM storage. It maintains a persistent representation of memory mappings and allocation state in NVRAM, serving as a mediator that reconstructs the memory landscape after crashes. This intermediary mechanism prevents information loss by preserving mapping information independently of volatile cache states.
Data Source
AI summary
Disclosed herein are innovations in memory management and data recovery for systems that operate using storage class memory (SCM), such as non-volatile RAM (NVRAM). The disclosed innovations have particular application to production database systems, where reducing database downtime in the event of a system crash is highly desirable. Embodiments of the disclosed technology can address a variety of problems that exist during a system crash. For example, embodiments of the disclosed technology can be used to address the loss of the physical memory mapping and/or the loss of the CPU cache that typically occurs in the event of a system crash. Furthermore, embodiments of the disclosed technology can be used to prevent data inconsistency and/or memory leak problems that may arise in the event of a system crash.


