Expand description
Memory pressure handling and resource limits
Prevents OOM crashes by implementing memory budgets and backpressure. Addresses Task 7 from task.md: Missing Memory Pressure Handling.
§WriteBufferManager (jj.md Task 2)
Coordinates memory usage across active and immutable memtables to prevent OOM:
- Tracks total buffer memory (active + immutable memtables)
- Enforces soft/hard limits with backpressure
- Triggers flush when memory pressure is detected
- Blocks writes when hard limit is exceeded
Structs§
- Memory
Budget - Memory budget configuration for the storage engine
- Memory
Tracker - Memory usage tracker with pressure detection
- Spillover
Manager - Async spillover manager for write buffers
- Spillover
Request - Request to spill data to secondary storage
- Spillover
Stats - Spillover statistics
- Write
Buffer Manager - Write Buffer Manager for coordinating memory across memtables
- Write
Buffer Stats - Statistics for write buffer monitoring