Skip to content

Commit

Permalink
Add --max-oldspace to launched Node-RED
Browse files Browse the repository at this point in the history
This is set to 75% of the max memory for the project to get GC to
kick in before the limit is reached
  • Loading branch information
hardillb committed Mar 11, 2022
1 parent 1b4da6c commit 13598e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class Launcher {
]

if (this.settings.stack?.['memory'] && /^[1-9]\d*$/.test(this.settings.stack['memory'])) {
processArguments.push(`--max-old-space-size=${this.settings.stack['memory']}`)
const memLimit = Math.round(this.settings.stack['memory'] * 0.75)
processArguments.push(`--max-old-space-size=${memLimit}`)
}

this.proc = childProcess.spawn(
Expand Down

0 comments on commit 13598e4

Please sign in to comment.