Node.js streaming server (server.js) memory leak, ~1 GB per 20 s, ends in kernel OOM kill

Open
#129 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js
Domain
backend

Research direction

Start with the bundled /usr/share/stremio/server.js and the streaming-proxy path around line 80165. Reproduce streaming followed by idle time while monitoring the node-MainThread RSS and journalctl output for repeated “Error: stream ended” messages. Done means the process no longer grows without bound or reaches an OOM kill under the reported scenario.

Written by the indexing model from the issue text.

Description

Installation type

Source

Version

v1.2.0

Platform

Cachyos

Desktop Environment

KDE

Windowing System

Wayland

GPU

AMD

Describe the bug
Bug: Node.js streaming server (server.js) memory leak, ~1 GB per 20 s, ends in kernel OOM kill

Version: stremio-linux-shell 1.2.0-1 (Arch package)
OS: CachyOS (Arch-based), kernel 7.1.8-1-cachyos, KDE Plasma 6 / Wayland
Hardware: Ryzen 5000, 16 GB RAM, Radeon RX 6700 XT (mesa/vulkan-radeon 26.1.6)
Related: node v26.7.0, mpv 0.41.0. Swap: zram 15.5 GB zstd, swappiness 150.

Description

While Stremio runs, the bundled Node.js server (/usr/share/stremio/server.js,
spawned as node-MainThread) grows without bound. Measured live:

  • RSS 3.1 GB → 4.2 GB in 20 seconds (~1 GB / 20 s) while idling after streaming.
  • Whole app unit peaked at 8.5 GB RAM + 10.2 GB swap in ~8 min, exhausting 16 GB
    RAM + 16 GB swap, after which the kernel OOM killer killed node-MainThread:
Out of memory: Killed process 27601 (node-MainThread)
  total-vm:21526164kB anon-rss:1491772kB file-rss:11520kB ... oom_score_adj:200
systemd[1400]: app-com.stremio.Stremio@...service: Failed with result 'oom-kill'.
systemd[1400]: ... Consumed 3min 18s CPU ... 8.5G memory peak, 10.2G memory swap peak.
Console output during leak
Error: stream ended
    at Socket.onFinished (/usr/share/stremio/server.js:80165:145)
...
2026-08-21T12:02:29.2Z ERROR stremio_linux_shell::app::webview: Failed to send message: TypeError: undefined is not a function

The leak appears tied to the streaming proxy — repeated Error: stream ended at
server.js:80165 while memory climbs.

The key evidence: ~1 GB/20 s growth in server.js's node process and the OOM log showing 8.5G peak + 10.2G swap. You can attach the full journalctl OOM block too.

Logs

No response

Dominant language
Rust
Stars
145
Forks
45
Avg merge
7h 8m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Stremio/stremio-linux-shell

All issues in Stremio/stremio-linux-shell

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.