tao-shen Claude Opus 4.6 commited on
Commit
fa6d97f
Β·
1 Parent(s): 25ff55e

fix: only set NODE_MEMORY_LIMIT when explicitly configured

Browse files

The default 512MB limit was too restrictive for OpenClaw startup.
Now NODE_MEMORY_LIMIT only applies if the env var is explicitly set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/entrypoint.sh +6 -5
scripts/entrypoint.sh CHANGED
@@ -16,13 +16,14 @@ DNS_START=$(date +%s)
16
  ) &
17
  DNS_PID=$!
18
 
19
- # ── Node.js memory limit ──────────────────────────────────────────────────
20
- NODE_MEMORY_LIMIT="${NODE_MEMORY_LIMIT:-512}"
21
- export NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--max-old-space-size=$NODE_MEMORY_LIMIT"
22
- echo "[entrypoint] Node.js memory limit: ${NODE_MEMORY_LIMIT}MB"
 
23
 
24
  # Enable Node.js DNS fix (will use resolved file when ready)
25
- export NODE_OPTIONS="${NODE_OPTIONS} --require /home/node/scripts/dns-fix.cjs"
26
 
27
  # ── Extensions symlink ──────────────────────────────────────────────────────
28
  SYMLINK_START=$(date +%s)
 
16
  ) &
17
  DNS_PID=$!
18
 
19
+ # ── Node.js memory limit (only if explicitly set) ─────────────────────────
20
+ if [ -n "$NODE_MEMORY_LIMIT" ]; then
21
+ export NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--max-old-space-size=$NODE_MEMORY_LIMIT"
22
+ echo "[entrypoint] Node.js memory limit: ${NODE_MEMORY_LIMIT}MB"
23
+ fi
24
 
25
  # Enable Node.js DNS fix (will use resolved file when ready)
26
+ export NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--require /home/node/scripts/dns-fix.cjs"
27
 
28
  # ── Extensions symlink ──────────────────────────────────────────────────────
29
  SYMLINK_START=$(date +%s)