Node.js
Performance Commands
Profile and optimize Node.js applications. Capture CPU profiles, track memory usage, detect leaks, and tune the V8 engine for better performance.
14 commands
Pro Tips
Use 'node --prof app.js' then 'node --prof-process isolate-*.log > profile.txt' to generate CPU profiles.
Track memory: 'node --max-old-space-size=4096' increases the V8 heap limit for memory-intensive apps.
Use 'process.memoryUsage()' at intervals to detect memory leaks — watch for heapUsed growing over time.
Common Mistakes
Profiling adds overhead. Don't run CPU profiles in production unless investigating a specific issue.
Increasing --max-old-space-size masks memory leaks instead of fixing them. Find and fix the root cause.