-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Bug Description
opencode.exe (v1.1.21) experienced a severe memory leak that consumed 113.4 GB of virtual memory, causing system-wide memory exhaustion, program crashes, and system unresponsiveness.
System Impact
- System memory fully exhausted
- Programs forced to close/crash
- System hitching/freezing
- General unresponsiveness
- No bluescreen occurred (Windows detected and managed the low memory condition)
Evidence
Windows Event Log - Resource Exhaustion Detector
Event ID: 2004
Source: Microsoft-Windows-Resource-Exhaustion-Detector
Time: 2/2/2026 6:36:46 PM
Windows successfully diagnosed a low virtual memory condition.
The following programs consumed the most virtual memory:
opencode.exe (PID 4572) consumed 121770086400 bytes (113.4 GB)
NVIDIA Broadcast.exe (10364) consumed 1498415104 bytes (1.4 GB)
Camera Hub.exe (16784) consumed 902610944 bytes (861 MB)
Environment
- OS: Windows (WinGet installation)
- opencode version: 1.1.21
- Installation method: WinGet (SST.opencode_Microsoft.Winget.Source_8wekyb3d8bbwe)
- System RAM: 9.8 GB available (at time of check)
Activity at Time of Incident
Based on opencode logs from the incident timeframe:
Active Components:
- Multiple agent sessions running (explore, sisyphus-junior, oracle, librarian, metis, momus, multimodal-looker)
- MCP (Model Context Protocol) clients active: memory, context7, grep_app, websearch
- External SSH connections to remote VPS servers
- LSP servers enabled: deno, typescript, vue, eslint, oxlint, biome, gopls, ruby-lsp, pyright, and 15+ others
Errors Observed in Logs:
ERROR service=mcp clientName=memory error=MCP error -32601: Method not found failed to get prompts
ERROR service=mcp clientName=context7 error=MCP error -32601: Method not found failed to get prompts
ERROR service=mcp clientName=grep_app error=MCP error -32601: Method not found failed to get prompts
Memory Configuration References Found:
- max_memory_restart: '2G' (observed in logs)
Additional Context
- Process was running for an extended period with multiple parallel agent operations
- System recovered after the resource exhaustion event
- Current opencode processes (post-restart) show normal memory usage (~800MB - 1.9GB)
- Log file from incident:
2026-02-03T002133.log(31MB, created at 6:38 PM)
Steps to Reproduce
Unknown - occurred during normal usage with multiple agents and MCP tools active.
Expected Behavior
Memory usage should remain stable and not grow unbounded, especially with max_memory_restart configured.
Actual Behavior
Virtual memory consumption grew to 113.4 GB despite 2G memory restart configuration, causing system-wide memory exhaustion.
Severity
🔴 CRITICAL - System stability impact, potential data loss from forced program closures
Possible Related Issues
- MCP error -32601 may indicate protocol issues contributing to memory leak
- Multiple concurrent agent sessions may not be properly releasing memory
- Memory restart limit (2G) not being enforced or ineffective
Reported by: Sisyphus (Kimi k 2.5) on behalf of user
Investigation Date: 2/2/2026
Incident Date: 2/2/2026 6:36 PM