Skip to content

Memory leak: chrome-devtools-mcp grows ~13 MB/min in --autoConnect mode, causes OOM #1192

@dzianisv

Description

@dzianisv

chrome-devtools-mcp leaks memory at ~13 MB/min in --autoConnect mode

Environment

  • chrome-devtools-mcp@0.19.0 via npm exec
  • macOS 15, Chrome 146
  • Running as MCP server under opencode serve (long-lived)

Observed behavior

After ~10 hours of idle operation, chrome-devtools-mcp --autoConnect --channel=stable consumed 1,661 MB RSS and contributed to a macOS kernel watchdog panic (swap exhaustion at 8.4 GB total process tree).

Live measurement today after ~9h41m uptime:

PID    RSS      VSZ     ELAPSED COMMAND
3106   303248   418351872  09:41:18 node chrome-devtools-mcp --autoConnect

303 MB RSS after 9.7 hours = growth rate of ~0.5 MB/min in today's session.

In a previous overnight session, the growth rate was steeper (~13 MB/min), reaching 1.66 GB in ~2 hours when Chrome had more active tabs.

Evidence from memory monitor

Our opencode memory monitor captured hourly snapshots. At the time of the crash:

Time Tree RSS Children chrome-devtools-mcp RSS
21:00 3,816 MB 42 652 MB
22:00 5,612 MB 55 1,126 MB
23:00 8,472 MB 55 1,661 MB
07:33 kernel panic (watchdog timeout, LOW swap space)

Expected behavior

An MCP server should have stable memory consumption when idle. A long-running process should not grow unboundedly.

Workaround

We added MCP idle sweep logic in the host (opencode) to periodically close MCP clients that haven't been used within a configurable window. This terminates the leaking process, but it would be better to fix the leak at the source.

Reproduction

  1. Start chrome-devtools-mcp --autoConnect --channel=stable as an MCP server
  2. Open Chrome with ~10-20 tabs
  3. Use the MCP tools occasionally over several hours
  4. Monitor RSS with ps -p <PID> -o rss periodically

RSS will grow continuously without bound. The growth rate correlates with the number of active Chrome tabs and DevTools protocol events.

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions