-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·53 lines (41 loc) · 1.54 KB
/
start.sh
File metadata and controls
executable file
·53 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# Yuno Gasai 2 - Production Startup Script
# Requires Node.js 24.0.0 or higher
# Enable Node.js 24 experimental features
export NODE_ENV=production
# Node.js 24 native SQLite support
NODE_OPTIONS="--experimental-sqlite"
# === MEMORY CONFIGURATION ===
# Detect if running on a low-memory system (Pi, embedded, <4GB RAM)
# Uncomment the appropriate line for your system:
# For Raspberry Pi 4 (8GB) - recommended settings:
NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=2048"
# For Raspberry Pi 4 (4GB):
# NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=1024"
# For Raspberry Pi 3/Zero or systems with <2GB:
# NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=512"
# For large servers (16GB+ RAM):
# NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=4096"
# === GARBAGE COLLECTION ===
# More aggressive GC for low-memory systems (reduces memory spikes)
# Uncomment for Pi/embedded systems:
GC_OPTIONS="--gc-interval=100"
# === ARM/FreeBSD FIX ===
# Disable Turbofan JIT optimizer - it generates illegal instructions on ARM FreeBSD
# This prevents SIGILL crashes (signal 4)
ARCH=$(uname -m)
case "$ARCH" in
aarch64|arm64|armv*)
ARM_FIX="--no-turbofan"
echo "Detected ARM architecture ($ARCH) - disabling Turbofan JIT"
;;
*)
ARM_FIX=""
;;
esac
# === NOTES ===
# If running on Pi with presence logging enabled, also set in config.json:
# "activityLogger.lowMemoryMode": true
# This enables buffer limits and automatic cleanup of stale data.
export NODE_OPTIONS
exec node $GC_OPTIONS $ARM_FIX index.js "$@"