diff --git a/package.json b/package.json index ec153cb..65fc5d9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "scripts": { "bundle": "npx rollup --config", - "start": "node src/app.js", + "start": "bash ./run.sh", "setup": "bash ./scripts/build_setup.sh", "build": "echo 'please run ./scripts/build_setup.sh first (one time only) and then ./scripts/compile.sh'", "clean": "rm -rf build/* bin/*", diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..14c31a4 --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +phys=$(free -t -m | grep -oP '\d+' | sed '10!d') +alloc=$(echo "$phys * 90/100" | bc ) +echo $alloc +node --max-old-space-size=$alloc src/app.js