Answer the question
In order to leave comments, you need to log in
How to limit memory usage for node.js processes?
Good day, I'm trying to remotely build a project on vue.js.
Hosting (Heroku) on a free plan gives 500 RAM, if you use more then the process kills.
I tried to start processes with
node --max_old_space_size=400 node_modules/.bin/vue-cli-service build
but it doesn't work. heroku[web.1]: Process running mem=800M(156.3%)
heroku[web.1]: Error R14 (Memory quota exceeded)
heroku[web.1]: Process running mem=1126M(220.0%)
heroku[web.1]: Error R15 (Memory quota vastly exceeded)
heroku[web.1]: Stopping process with SIGKILL
"dependencies": {
"@vue/cli-service": "^3.0.3",
}
"engines": {
"node": "9.9.0",
"npm": "5.6.0"
},
Answer the question
In order to leave comments, you need to log in
Huroku allocates up to 1.5GB of RAM to the build process. It was enough to transfer the vue.js assembly to the hook script after installing the
package.json dependencies
"scripts": {
"build": "vue-cli-service build",
"postinstall": "npm run build"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question