Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork12
Code to test how much memory is available with Node.js
License
Data-Wrangling-with-JavaScript/nodejs-memory-test
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A test program to estimate how much heap memory is available to a Node.js application.
This example code accompanies the bookData Wrangling with JavaScript.
There is also a relatedblog post andvideo.
If you're a JavaScript developer, you already know that working with data is a big deal. Why let the Python and R coders get all the glory? JavaScript isn't just good at data visualization, you can move your entire data wrangling pipeline to JavaScript and work more effectively.Data Wrangling with JavaScript teaches you core data munging techniques in JavaScript, along with many libraries and tools that will make your data tasks even easier.
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:
node index.jsLet this run for a while and it will eventually abort with a fatal out of memory error like this:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryThe 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.jsYou should now have much more heap memory to play with!
About
Code to test how much memory is available with Node.js
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
