Node.js Memory Leaks from Frequent Allocations? glibc Mechanism and Fixes
_jzhao · x · 2026-07-31
The author points out a weird behavior in glibc where free() does not return memory for interior free chunks back to the OS. Because Node.js, libuv, and V8 never call malloctrim(0) to fix this, Node applications that allocate and recycle Buffers really frequently can cause memory to leak.
A workaround is provided using an LDPRELOAD library and configuring the MALLOCCONF environment variable (e.g., setting dirtydecayms).
More from coding & agent
- PipeWire Sandbox Escape Vulnerability (CVE-2026-5674) Discovered via Claude Code — wunderwuzzi23 · 2026-07-31
- Agent Arena Leaderboard Updates: Claude Fable 5 Takes #1 — arena · 2026-07-31
- Strategy Advisor Shares AI Agent Team Orchestration Workflow — ry6655 · 2026-07-31
- Graperoot: Open-Source Tool Turns Codebase into Knowledge Graph, Saving Claude Users $350k — intellinker · 2026-07-31
- Debate Erupts Over OpenAI vs Anthropic Default Chain-of-Thought Retention in APIs — steipete · 2026-07-31
- Andrew Ng Uses Coding Agents to Turn Slides Interactive, Run LLMs in Browser — yuntiandeng · 2026-07-31