A test program to estimate how much heap memory is available to a Node.js application.
To keep up with my work please follow @ashleydavis75 on Twitter or sign up to the email list on my blog The Data Wrangler.
Clone the repo to your local hard drive and change directory to the repo.
No dependencies are required.
To determine the largest amount of memory that can be allocated in Node.js run:
Let this run for a while and it will eventually abort with a fatal out of memory error like this:
The last line of text printed tells you the total amount of heap memory available to your application under Node.js.
Now try increasing heap memory, add the '--max-old-space-size' command line parameter as follows and run it again:
node --max-old-space-size=6000 index.js
You should now have much more heap memory to play with!