refactor(node-heap): raise auto cap to 12GB and simplify OOM hint

- Increase setup_nodejs auto heap clamp from 4GB to 12GB for heavy frontend builds
- Keep lower bound at 1GB and preserve user override precedence
- Simplify error_handler Node OOM output to a single concise hint
- Align error_handler heap suggestion clamp to 12GB
This commit is contained in:
CanbiZ (MickLesk)
2026-04-23 13:58:55 +02:00
parent 4241fd10da
commit 450c1f37a0
2 changed files with 7 additions and 11 deletions
+3 -3
View File
@@ -6426,7 +6426,7 @@ function setup_nodejs() {
# 2) NODE_MAX_OLD_SPACE_SIZE (explicit MB override)
# 3) var_ram (LXC memory setting, MB)
# 4) /proc/meminfo (runtime memory detection)
# Auto value is clamped to 1024..4096 MB.
# Auto value is clamped to 1024..12288 MB.
if [[ -z "${NODE_OPTIONS:-}" ]]; then
local node_heap_mb=""
@@ -6445,8 +6445,8 @@ function setup_nodejs() {
if [[ -z "$node_heap_mb" ]] || ((node_heap_mb < 1024)); then
node_heap_mb=1024
elif ((node_heap_mb > 4096)); then
node_heap_mb=4096
elif ((node_heap_mb > 12288)); then
node_heap_mb=12288
fi
export NODE_OPTIONS="--max-old-space-size=${node_heap_mb}"