Skip to content

[Issue] Massive Memory Leak / OOM Crash on initial Trakt Import (~1100 items) #1375

Description

@drgoyo

Describe the bug

Critical memory leak / OOM (Out of Memory) crash during the initial Trakt library synchronization. The container consumed all available host RAM (48 GB), leading to a kernel panic/OOM-kill of essential host processes (Unraid WebGUI/php-fpm). This occurred on the latest Unraid 7 release.

To Reproduce

  1. Install Riven using the :dev tag.
  2. Configure a Trakt account with a large watchlist/collection (approx. 1100 items).
  3. Start the initial synchronization/scrape process.
  4. Monitor RAM usage: It spikes uncontrollably until system saturation.

Expected behavior

Memory usage should remain stable during metadata processing. Large imports should be batched or memory should be cleared using aggressive garbage collection to stay within reasonable limits (e.g., 2-4 GB).

Environment

  • OS: Unraid 7.2.3 (Kernel: 6.12.54-Unraid)
  • CPU: AMD Ryzen 5 PRO 4650G
  • RAM: 48 GB DDR4
  • Installation Type: Docker Compose
  • Image: spoked/riven:dev (Pulled Feb 15, 2026)

Riven Configuration (Environment Variables)

  • RIVEN_FILESYSTEM_CACHE_MAX_SIZE_MB=10240
  • RIVEN_FILESYSTEM_CHUNK_SIZE_MB=16
  • RIVEN_FILESYSTEM_FETCH_AHEAD_CHUNKS=10

Logs (Host OOM-Killer evidence from Unraid 7.2.3)

Feb 15 12:12:43 Tower php-fpm[14355]: [WARNING] [pool www] child 221973 exited on signal 9 (SIGKILL) after 12.973920 seconds from start
Feb 15 12:12:56 Tower php-fpm[14355]: [WARNING] [pool www] child 222249 exited on signal 9 (SIGKILL) after 12.992889 seconds from start
Feb 15 12:13:09 Tower php-fpm[14355]: [WARNING] [pool www] child 222258 exited on signal 9 (SIGKILL) after 13.290010 seconds from start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions