Need help with increase-memory-limit?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

endel
242 Stars 24 Forks MIT License 29 Commits 10 Opened issues

Description

Increase memory limit for local node binaries ("max-old-space-size")

Services available

!
?

Need anything else?

Contributors list

# 9,326
Three.j...
glsl
dotnet-...
unity3d
14 commits
# 134,364
uber
CSS
React
mapbox-...
2 commits
# 598,000
JavaScr...
node
1 commit
# 75,452
reactjs
context...
mustach...
Postgre...
1 commit
# 7,346
clean-c...
Ember
nvm
node-js
1 commit
# 255,043
node
Markdow...
vuejs
vue-plu...
1 commit

DEPRECATION NOTICE

As of Node.js v8.0 shipped August 2017, you can now use the

NODE_OPTIONS
environment variable to set the maxoldspace_size globally. (#19)
export NODE_OPTIONS=--max_old_space_size=4096

increase-memory-limit

Workaround to fix

heap out of memory
when running node binaries. It's a common issue when using TypeScript 2.1+ and webpack.

This tool will append

--max-old-space-size=4096
in all
node
calls inside your
node_modules/.bin/*
files.
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

How to use

npm install -g increase-memory-limit

Run from the root location of your project:

increase-memory-limit

Running from NPM task

Alternatively, you can configure a npm task to run the fix.

// ...
  "scripts": {
    "fix-memory-limit": "cross-env LIMIT=2048 increase-memory-limit"
  },
  "devDependencies": {
    "increase-memory-limit": "^1.0.3",
    "cross-env": "^5.0.5"
  }
// ...
npm run fix-memory-limit

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.