Skip to content

Instantly share code, notes, and snippets.

@ASteinheiser
Last active March 5, 2026 17:49
Show Gist options
  • Select an option

  • Save ASteinheiser/c2d25233c521da3d2261ddce932372f1 to your computer and use it in GitHub Desktop.

Select an option

Save ASteinheiser/c2d25233c521da3d2261ddce932372f1 to your computer and use it in GitHub Desktop.
Snippet for debugging memory issues in Node.js applications
import numeral from 'numeral';
setInterval(() => {
const { rss, heapTotal, heapUsed, external } = process.memoryUsage();
console.log('--------------------------------');
console.log('rss: ', numeral(rss).format('0.0 ib'));
console.log('heapTotal: ', numeral(heapTotal).format('0.0 ib'));
console.log('heapUsed: ', numeral(heapUsed).format('0.0 ib'));
console.log('external: ', numeral(external).format('0.0 ib'));
console.log('--------------------------------');
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment