Understand the 3-tier memory cap for the memtable cache
mainThe memtable cache uses a three-tier memory management system to prevent excessive memory consumption:
- Per-index soft cap: Limits memory usage for a specific index.
- Global soft cap: Limits total memory usage across all indices. When this limit is reached, the system uses
evict_largest(protected byglobal_eviction_mutex) to remove items, while ensuring the caller's own index is not evicted. - Global hard cap: A strict limit on total memory usage.