Skip to content

Gateway RSS grows to 900MB+ rapidly on macOS MacBook Air after fresh restart #69977

Description

@GenieWeenie

Bug Report: Gateway Memory Bloat on macOS

Environment

  • OpenClaw version: 2026.4.20 (upgraded from 2026.4.15)
  • macOS: Darwin 24.6.0 (macOS 26 on MacBook Air)
  • RAM: 8GB MacBook Air
  • Node: v22.22.0

Problem

The openclaw-gateway process RSS grows to 900MB+ within minutes of a fresh restart, regardless of session count or dreaming state.

Timeline of Testing (2026-04-21)

State RSS CPU
136 sessions, dreaming ON 1,128 MB 170%
Pruned to 3 sessions, dreaming ON 573 MB → 901 MB climbing
3 sessions, dreaming OFF 526 MB (cold) → 908 MB (2 min later) 52%
Just this Discord session (5.7MB jsonl) still 900MB+ still high

What We Tried

  1. Aggressive session prune — reduced from 136 to 3 sessions, archived 129 jsonl files. Helped briefly (526MB cold) but climbed right back to 900MB.
  2. Disabled memory-core dreaming — no sustained improvement. Gateway still bloats to 900MB within minutes.
  3. Moved archive outside sessions dir — ensured no stale file scanning.
  4. openclaw doctor — killed by macOS OOM before it could complete (3 attempts).
  5. Multiple gateway restarts — same pattern each time: cold start ~500MB, climbs to 900MB+ within minutes.

2026.4.20 Fixes That Should Have Helped

  • Sessions/Maintenance: enforce the built-in entry cap and age prune by default, and prune oversized stores at load time so accumulated cron/executor session backlogs cannot OOM the gateway before the write path runs. (#69404)
  • Memory-core/dreaming: normalize sweep timestamps and reuse hashed narrative session keys for fallback cleanup so Dreaming narrative sub-sessions stop leaking. (#67023)

Despite these fixes, the gateway still bloats rapidly.

Active Plugins

  • memory-core (dreaming disabled during test)
  • memory-wiki (enabled, 7 syntheses, minimal data)
  • discord, telegram, voice-call
  • zai, google, stepfun, openai, kimi (disabled)

Impact

On an 8GB MacBook Air, 900MB+ RSS causes:

  • macOS killing child processes (openclaw doctor killed 3 times)
  • Gateway becomes unresponsive / control UI goes down
  • Memory watchdog triggers restarts, creating instability cycle

Expected Behavior

Gateway RSS should stabilize well under 750MB on a machine with only 3 active sessions and dreaming disabled.

Reproduction

  1. Fresh install of OpenClaw 2026.4.20 on macOS MacBook Air (8GB)
  2. Start gateway
  3. Observe RSS climb from ~500MB to 900MB+ within 2-5 minutes
  4. Continue using normally — RSS does not stabilize

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions