Profiling Puppeteer Memory Usage in Node.js
A puppeteer memory leak shows up as RSS growing over hours until your container gets OOM-killed. Finding the actual source requires heap snapshots, not guesswork. This guide walks through profiling...

Source: DEV Community
A puppeteer memory leak shows up as RSS growing over hours until your container gets OOM-killed. Finding the actual source requires heap snapshots, not guesswork. This guide walks through profiling Puppeteer memory step by step: setting up monitoring, establishing a baseline, running load tests, capturing heap snapshots, comparing them to find retained objects, and identifying what's actually leaking. Understanding Node.js Memory Metrics Before profiling, you need to know what the numbers mean. Node.js exposes four memory metrics through process.memoryUsage(): Metric What It Measures Puppeteer Relevance rss Resident Set Size: total physical memory allocated to the process Your actual memory footprint. Includes code, stack, heap, and buffers. heapUsed V8 heap memory currently in use JavaScript objects. If this grows, you have a JS-level leak. heapTotal V8 heap memory allocated V8 may allocate more than it uses. Growth here without heapUsed growth means fragmentation. external Memory use