Module memory

Module memory 

Source
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§

MemoryBudget
Memory budget configuration for the storage engine
MemoryTracker
Memory usage tracker with pressure detection
SpilloverManager
Async spillover manager for write buffers
SpilloverRequest
Request to spill data to secondary storage
SpilloverStats
Spillover statistics
WriteBufferManager
Write Buffer Manager for coordinating memory across memtables
WriteBufferStats
Statistics for write buffer monitoring