Files
3m-ui/scripts
Z User d50664377f feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
feat(mem): Go runtime memory auto-tuning (no swap, no mmap)
Pure Go runtime tuning via GOMEMLIMIT + GOGC, applied at every stage
of install AND update. No swap file creation. No mmap tricks.
4-tier auto-detection based on /proc/meminfo:
RAM ≤ 128MB:  GOMEMLIMIT=48MiB  GOGC=20  MemoryMax=72M
RAM ≤ 256MB:  GOMEMLIMIT=96MiB  GOGC=50  MemoryMax=144M
RAM ≤ 512MB:  GOMEMLIMIT=192MiB GOGC=75  MemoryMax=288M
RAM > 512MB:  off               GOGC=100 MemoryMax=infinity
Applied to:
1. Early: export GOMEMLIMIT/GOGC before install_deps so download +
extract + init all inherit the limits.
2. init step: explicitly passed GOMEMLIMIT/GOGC to the Go binary.
3. healthcheck: explicitly passed to the Go binary.
4. systemd unit: Environment=GOMEMLIMIT=... + Environment=GOGC=...
+ MemoryMax=... (hard OOM cap, kills panel not SSH).
5. OpenRC unit (Alpine): export GOMEMLIMIT/GOGC (OpenRC doesn't
support MemoryMax, but GOMEMLIMIT handles it at Go runtime level).
Override: THREE_M_UI_GOMEMLIMIT=80MiB THREE_M_UI_GOGC=75
Why this works without swap:
- GOMEMLIMIT tells Go GC 'you have X MiB of heap, GC aggressively
to stay under it'. Go runtime respects this natively (Go 1.19+).
- GOGC=20 means GC triggers at 1.2x live heap (vs default 2x),
keeping RSS tight at the cost of ~3-5% more CPU.
- MemoryMax is the systemd safety net: if Go somehow leaks past
GOMEMLIMIT×1.5, systemd kills the panel (which Restart=always
brings back), not SSH.
- No swap needed: the goal is to keep RSS within physical RAM,
not to extend virtual memory.
2026-09-26 07:28:17 +00:00
..