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

Relational Memory for LLMs: Three-Layer System Models User Relationships
An open-source Python tool that adds relational memory to LLMs by modeling user-AI relationships across seven psychological dimensions, using a three-layer narrative structure instead of flat fact storage.

Nudge: A local-first app that surfaces Claude-generated plans via contextual triggers
Nudge is a free, local-first iOS/Android app that lets you paste markdown plans (from Claude, ChatGPT, Notes) and attach triggers like time, location, Wi-Fi, inactivity, or one-time to surface them via local notifications.

GLM-5.1 vs MiniMax M2.7: Performance comparison for AI coding agents
GLM-5.1 achieves SWE-bench-Verified 77.8 and Terminal Bench 2.0 56.2 scores, the highest among open-source models, while MiniMax M2.7 offers fast responses with low TTFT and high throughput ideal for CI bots and batch edits.

Building an Autonomous Research Agent with C# and Local LLMs
A C# research agent automates URL processing with local LLMs using Ollama and llama3.1:8b, generating structured markdown reports from web searches.