Summary
After indexing a small project (65 files, 1.3MB, 2509 nodes), codebase-memory-mcp retains 20GB+ RSS on a 32GB Windows machine. Memory grows monotonically and is never released to the OS.
Environment
- OS: Windows 11, i7-12700 (20 cores), 32GB RAM
- CBM Version: 0.8.1
- Project: 65 Markdown files, 1.3MB, 2509 nodes
Root Cause (from source code)
- mimalloc abandoned-thread arenas not purged (mem.c missing mi_option_abandoned_thread_purge)
- Default worker count uses all 20 cores, each with its own mimalloc arena
- DEFAULT_RAM_FRACTION=0.5 means 16GB budget, no pressure to release
Observed memory
Without fix: 20GB+ RSS, growing 600MB/min, never releases
With workaround (CBM_WORKERS=1): 13MB stable
Fix
PR #831: #831
- Enable mi_option_abandoned_thread_purge in mem.c
- Lower DEFAULT_RAM_FRACTION from 0.5 to 0.25
- Cap initial worker count at 8 in system_info.c
Workaround
Set CBM_WORKERS=1 in MCP env config and run: codebase-memory-mcp config set auto_index false
Summary
After indexing a small project (65 files, 1.3MB, 2509 nodes), codebase-memory-mcp retains 20GB+ RSS on a 32GB Windows machine. Memory grows monotonically and is never released to the OS.
Environment
Root Cause (from source code)
Observed memory
Without fix: 20GB+ RSS, growing 600MB/min, never releases
With workaround (CBM_WORKERS=1): 13MB stable
Fix
PR #831: #831
Workaround
Set CBM_WORKERS=1 in MCP env config and run: codebase-memory-mcp config set auto_index false