Skip to content

Memory leak: thousands of smallcode.js --mcp processes spawning #82

@thehybrid1337

Description

@thehybrid1337

Describe the bug

Smallcode leaks Node.js worker processes indefinitely. After sending my first ever prompt, 3006 node smallcode.js --mcp processes spawned and accumulated in the background consuming all available system RAM.

To Reproduce

  1. Install smallcode (npm install -g smallcode)
  2. Configure a provider and model
  3. Send a single message (e.g. "hey")
  4. Check: ps aux | grep smallcode | grep -v grep | wc -l

Behavior

3006 node ~/.smallcode/bin/smallcode.js --mcp processes were running simultaneously, consuming approximately 50 GB of RAM on a 64 GB system. No swap configured — kernel OOM killer triggered.

$ ps aux | grep "smallcode.js" | grep -v grep | wc -l
 3006

 $ free -h 
 Mem:  62Gi  61Gi  377Mi

 After killing all processes manually:

 $ free -h
 Mem:  62Gi  10Gi  50Gi

Observations

~/.smallcode/sessions
❯ ls | wc -l
3007(!) .json files with same content
{
  "id": "2go5k8fi3cg-6b6326",
  "title": "",
  "model": "Qwopus3.5-9B-Coder-GGUF",
  "messages": [],
  "tokens": {
    "input": 0,
    "output": 0,
    "total": 0
  },
  "cost": 0,
  "toolCalls": 0,
  "createdAt": "2026-06-04T09:05:06.447Z",
  "updatedAt": "2026-06-04T09:05:06.447Z"
}

~/.smallcode/mcp.json registers ollama_host? i had configured custom provider. (lemonade)

  "mcpServers": {
    "smallcode": {
      "command": "smallcode",
      "args": ["--mcp"],
      "env": {
        "OLLAMA_HOST": "http://localhost:11434"
      },
      "disabled": true,
      "autoApprove": [
        "smallcode_read_file",
        "smallcode_search",
        "smallcode_find_files",
        "smallcode_symbols",
        "smallcode_memory"
      ]
    }
  }
}

Environment

  • OS: CachyOS Linux (Linux 7.0.1-1-cachyos-kernel)
  • Node version: v25.8.2
  • smallcode version: v1.6.0

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