Skip to content

FATAL ERROR: Ineffective mark-compacts near heap limit #1905

@fontvu

Description

@fontvu

Description:
9router crashes immediately upon startup with a JavaScript heap out of memory error when running inside Docker (WSL2 backend).

This occurs specifically when initializing a "Fusion" strategy combo that includes a large number of models (~73). The application attempts to load the entire routing configuration into the default Node.js heap (approx 1.4GB - 2GB) upon startup, exceeding the limit even though the host machine has sufficient RAM (16GB+ allocated to WSL).

Steps to Reproduce:

  • Environment: Windows 11 running Docker Desktop with WSL2 integration enabled.
  • Allocate 16GB RAM to WSL via .wslconfig.
  • Configure 9router with an "Auto" combo using strategy: fusion.
  • Populate this combo with ~70+ models (e.g., via Kiro, GLM, OpenRouter, Nvidia, Cloudflare providers).
  • Run the container:

docker run -d --name 9router -p 20128:20128 \ -v "$HOME/.9router:/app/data" \ -e DATA_DIR=/app/data \ decolua/9router:latest

  • Check logs: docker logs -f 9router
  • Expected Behavior: The server should start and listen on port 20128, initializing the routing table successfully.
  • Actual Behavior: The container exits repeatedly with the following crash log:

--- Server crash log --- <--- Last few GCs ---> [...] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory ----- Native stack trace ----- 1: 0x744ae8 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [next-server (v16.2.1)] ...

Logs immediately preceding the crash show the initialization of the large combo:

[08:15:50] ℹ️ [CHAT] Combo "auto" with 73 models (strategy: fusion)
[08:15:50] ℹ️ [FUSION] Combo "auto" | panel=73 [auto, cc/claude-sonnet-4-6, kr/MiniMax-M2.5, ...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions