GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Memory leak during long-running session with multiple bash tool calls · Issue #33385 · anomalyco/opencode

Memory leak during long-running session with multiple bash tool calls #33385

New issue
Copy link
New issue
Copy link
Closed
Closed
Memory leak during long-running session with multiple bash tool calls#33385
Copy link
Assignees
StarpTech

Description

@lildengzi
lildengzi
opened on Jun 22, 2026
Issue body actions

Description

envirment:
tools value

Node v26.1.0
Shell fish, inside kitty terminal
RAM 14GB + 14GB swap
CPU AMD Ryzen 7 6800H
description:
During a ~2 hour interactive session involving many consecutive bash tool invocations (setting up a macOS KVM), the opencode process RSS grew monotonically from ~300MB to a peak of 8.6GB (reported by systemd for the parent kitty scope, opencode as dominant child).
The bash subprocess group alone peaked at 468MB, and open_code.db grew to ~70MB. No OOM kill occurred only due to 14GB swap + CachyOS aggressive reclaim. Meanwhile a QEMU VM consuming 4.9GB RSS was also running on the same host, making total pressure ~13.5GB.
No explicit errors in ~/.local/share/opencode/log/opencode.log (1.8MB, 10093 lines).

influence:
Near-OOM on a 14GB host with swap thrashing. Lighter hosts would trigger OOM kill.
guess:
Buffered bash tool output or tool-call history not released between invocations.

Plugins

No response

OpenCode version

1.17.8

Steps to reproduce

  1. Start a long session with heavy tool-call throughput (e.g. quickemu macOS setup)
  2. Make many consecutive bash calls over ~2 hours
  3. Monitor with ps aux --sort=-%mem — RSS grows monotonically

Screenshot and/or share link

No response

Operating System

OS CachyOS (Arch Linux), kernel 7.0.12 LTO

Terminal

kitty

Activity

  1. github-actions
    assigned
    StarpTech
    on Jun 22, 2026
  2. github-actions commented on Jun 22, 2026

    @github-actions
    github-actionsBot
    on Jun 22, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • Memory Megathread #20695: Memory Megathread — the central tracking issue for memory problems; maintainers are collecting heap snapshots there to diagnose and fix memory growth issues
    • OOM kill: message history accumulation causes 8.5GB memory usage during task execution #29730: OOM kill — message history accumulation causes 8.5GB memory usage during task execution (very similar symptoms: ~8.5GB peak, ~70MB db, long session with many tool calls)
    • server mode: long-running opencode serve accumulates anonymous JS heap/swap; 26.8GiB cgroup peak, WKFastMalloc/JSJITCode #33213: long-running opencode accumulates heap/swap with 26GB+ cgroup peak

    If your issue matches what is described in #20695, please consider contributing a heap snapshot there following the instructions in that thread — it would help the maintainers trace and fix the root cause.

  3. lildengzi
    closed this as completedon Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @StarpTech
    StarpTech

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.