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

MCP Support Merged into llama.cpp with New WebUI Features
The Model Context Protocol (MCP) pull request for llama.cpp has been merged, adding MCP support, tool calls, an agentic loop, and a server selector to the llama-server/WebUI side.

NexQuant: Rust-native 3-bit KV-cache engine for edge deployment
NexQuant is a production-hardened Rust engine that enables running high-context models on consumer hardware with 3-5x memory reduction. It supports Metal, CUDA, Vulkan, and CPU backends.

One-Command Docker Setup for OpenClaw with Full-Disk Encryption and Monitoring
A Docker setup for OpenClaw that provides full-disk encryption guides, Tini as PID 1, built-in monitoring tools, and data stored as plain files on the host. Deployment requires just two commands: git clone and ./shell.

DreamScape: Browser-Based 3D World Builder Powered by Claude Code and MCP
DreamScape is a browser-based 3D world builder where Claude Code controls 30 MCP tools to generate terrain, models, weather, and behaviors in real time through natural language commands.