Make NODE_MEMORY_LIMIT a configurable addon option (default 512 MB)

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/c45f9e34-4233-4929-96c9-50c7db39ac6d
This commit is contained in:
copilot-swe-agent[bot]
2026-03-22 17:12:42 +00:00
parent f6750c806a
commit d20d1199fe
4 changed files with 12 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
## 3.1.0-2 (22-03-2026)
- Added configurable `NODE_MEMORY_LIMIT` option (default 512 MB) to control Node.js heap size and prevent OOM kills
## 3.1.0 (22-03-2026)
- Set default Node.js memory limit (512MB) to prevent OOM kills that caused the addon to stop responding
- Update to latest version from seerr-team/seerr (changelog : https://github.com/seerr-team/seerr/releases)

View File

@@ -26,6 +26,7 @@ Use `env_vars` to pass extra environment variables when needed. Seerr configurat
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `NODE_MEMORY_LIMIT` | int | `512` | Maximum Node.js heap memory in MB. Increase if Seerr crashes with large libraries; decrease on memory-constrained systems. |
| `PGID` | int | `0` | Group ID for file permissions |
| `PUID` | int | `0` | User ID for file permissions |
| `TZ` | str | | Timezone (e.g. `Europe/London`) |
@@ -33,6 +34,7 @@ Use `env_vars` to pass extra environment variables when needed. Seerr configurat
### Example
```yaml
NODE_MEMORY_LIMIT: 512
env_vars: []
PGID: 0
PUID: 0

View File

@@ -74,6 +74,7 @@ map:
- addon_config:rw
name: Seerr
options:
NODE_MEMORY_LIMIT: 512
env_vars: []
PGID: "0"
PUID: "0"
@@ -87,10 +88,11 @@ schema:
env_vars:
- name: match(^[A-Za-z0-9_]+$)
value: str?
NODE_MEMORY_LIMIT: int
PGID: int
PUID: int
TZ: str?
slug: seerr
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/seerr
version: "3.1.0"
version: "3.1.0-2"

View File

@@ -4,10 +4,11 @@ set -e
cd /app || exit 1
# Set default Node.js memory limit to prevent OOM kills
# Users can override this via the addon's env_vars option (NODE_OPTIONS)
# Set Node.js memory limit from addon option to prevent OOM kills
# NODE_MEMORY_LIMIT is exported as env var by 00-global_var.sh from config.yaml
MEMORY_LIMIT="${NODE_MEMORY_LIMIT:-512}"
if [[ "${NODE_OPTIONS:-}" != *"max-old-space-size"* ]] && [[ "${NODE_OPTIONS:-}" != *"max_old_space_size"* ]]; then
export NODE_OPTIONS="${NODE_OPTIONS:+${NODE_OPTIONS} }--max-old-space-size=512"
export NODE_OPTIONS="${NODE_OPTIONS:+${NODE_OPTIONS} }--max-old-space-size=${MEMORY_LIMIT}"
fi
bashio::log.info "Starting Seerr..."