Files
ProxmoxVE/misc/tools.func
CanbiZ (MickLesk) fdab25b098 core: auto-size NODE_OPTIONS heap (#13960)
* feat(nodejs): auto-size NODE_OPTIONS heap and apply in Termix updates

- setup_nodejs now sets NODE_OPTIONS only when not already set
- Heap size is auto-derived from NODE_MAX_OLD_SPACE_SIZE, var_ram, or MemTotal
- Auto heap is clamped to 1024..4096 MB to avoid too-small or too-large defaults
- Termix update path now calls setup_nodejs before frontend/backend builds so
  Node heap defaults are applied consistently during updates

* feat(error-handler): add actionable Node.js heap OOM guidance

Detect probable Node.js heap out-of-memory failures from log patterns and
common build exit codes, then print targeted remediation hints instead of
only a generic SIGABRT/SIGKILL message.

- Detect OOM patterns in last log lines (Reached heap limit, JS heap OOM)
- Treat node build contexts with exit 134/137/243 as likely heap issues
- Suggest computed --max-old-space-size based on NODE_OPTIONS, var_ram,
  or MemTotal (clamped to 1024..4096 MB)
- Recommend calling setup_nodejs before build steps so defaults apply

* 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
2026-04-23 22:17:25 +02:00

300 KiB