Claude Code Memory Leak Fix for Linux Homelabs

Memory Leak Details
A developer running a Proxmox homelab with 64 cores and 503GB RAM experienced repeated crashes when using Claude Code to manage VMs, GitLab, DNS, and other services. Despite upgrading to 500GB RAM, Claude Code consumed 400GB and crashed the entire system.
Memory dump analysis revealed:
- 1.15 billion identical 160-byte objects in heap
- Objects never freed (free=0)
- Growth rate of ~32,000 objects per second during active use
- Idle usage is normal
Technical Findings
The investigation uncovered:
- Claude Code is built on Bun runtime
- Uses two allocators: mimalloc + glibc malloc
- Leak is in glibc malloc side
- JavaScript-level fixes don't work due to allocator layer
- This has been an open issue for months with dozens of GitHub reports
Two-Tier Fix Solution
The developer created a Linux-only solution:
Tier 1 (10GB threshold): LD_PRELOAD shim that intercepts malloc(160) calls and caps growth. Zero overhead until threshold is reached.
Tier 2 (20GB threshold): Watchdog that restarts the session if Tier 1 isn't sufficient, acting as a safety net.
The fix is available at github.com/dalsoop/claude-code-memory-leak-fix.
📖 Read the full source: r/ClaudeAI
👀 See Also

Claude Code Best Practice GitHub repository reaches 5,000 stars
A GitHub repository called 'claude-code-best-practice' has reached 5,000 stars. The repository was created with Claude to document best practices, tips, and workflows from both the creator and the community.

Developer Tests Qwen3.5 27B vs Larger Models for Local Coding Tasks
A developer tested multiple Qwen3.5 and Nemotron models, finding Qwen3.5-27B-GGUF:UD-Q6_K_XL performs well for development tasks on existing 2x RTX 3090 hardware, with 803 pp and 25 tg/s at 256k context on vast.ai.

RepoLens: Interactive Local Codebase Packer and Token Optimizer (TUI/CLI) in Go
RepoLens is a zero-dependency Go tool that packs repos into LLM context with a TUI file explorer, live token counter, comment stripping, secret scanner, and token-based file splitting.

Google Research introduces TurboQuant for AI model compression
Google Research has introduced TurboQuant, a compression algorithm that reduces AI model size with zero accuracy loss. It addresses memory overhead in vector quantization and improves key-value cache performance.