Skip to content

Instantly share code, notes, and snippets.

@hanut
Created February 7, 2025 15:30
Show Gist options
  • Select an option

  • Save hanut/8f13e42d090a4a85fdf95972bd95c260 to your computer and use it in GitHub Desktop.

Select an option

Save hanut/8f13e42d090a4a85fdf95972bd95c260 to your computer and use it in GitHub Desktop.
Get the max allocated size of memory for a nodejs process

This is a one line command for the cli that will spit out the amout of RAM allocated (approximately) to your nodejs process.

$ node -e "console.log(Math.round(require('v8').getHeapStatistics().heap_size_limit / (1024*1024)))"

The output value is in the megabytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment