openclaw - 💡(How to fix) Fix [Bug]: 2026.4.29 gateway consumes 100% CPU on one core due to ~50 setInterval timers [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#75743Fetched 2026-05-02 05:30:53
View on GitHub
Comments
3
Participants
4
Timeline
8
Reactions
6
Author
Timeline (top)
commented ×3cross-referenced ×2subscribed ×2closed ×1

After upgrading to 2026.4.29, the gateway Node.js process continuously consumes ~100% CPU on one core, causing sustained heat on Mac mini (M4). This did not occur on 2026.4.23.

Root Cause

After upgrading to 2026.4.29, the gateway Node.js process continuously consumes ~100% CPU on one core, causing sustained heat on Mac mini (M4). This did not occur on 2026.4.23.

Fix Action

Fix / Workaround

4085 Thread  DispatchQueue_1: com.apple.main-thread
  → uv_run → uv__run_timers
    → node::Environment::RunTimers(uv_timer_s*)
      → v8 execution:
        → Builtins_ArrayMap (array mapping)
        → Builtins_ArrayFrom (array conversion)
        → Builtins_CallApiCallbackOptimizedNoProfiling
          → node::fs::LStat (filesystem stat)

Code Example

4085 Thread  DispatchQueue_1: com.apple.main-thread
  → uv_run → uv__run_timers
    → node::Environment::RunTimers(uv_timer_s*)
      → v8 execution:
Builtins_ArrayMap (array mapping)
Builtins_ArrayFrom (array conversion)
Builtins_CallApiCallbackOptimizedNoProfiling
          → node::fs::LStat (filesystem stat)
RAW_BUFFERClick to expand / collapse

Description

After upgrading to 2026.4.29, the gateway Node.js process continuously consumes ~100% CPU on one core, causing sustained heat on Mac mini (M4). This did not occur on 2026.4.23.

Sampling evidence (macOS sample)

97% of CPU time is spent in a repeating timer loop:

4085 Thread  DispatchQueue_1: com.apple.main-thread
  → uv_run → uv__run_timers
    → node::Environment::RunTimers(uv_timer_s*)
      → v8 execution:
        → Builtins_ArrayMap (array mapping)
        → Builtins_ArrayFrom (array conversion)
        → Builtins_CallApiCallbackOptimizedNoProfiling
          → node::fs::LStat (filesystem stat)

Findings

  • ~50 setInterval callbacks are registered across various gateway components
  • Timer callbacks perform heavy ArrayMap/ArrayFrom operations on session/trajectory data
  • Frequent lstat calls (filesystem scanning, likely wiki vault paths)
  • Cumulative effect: one CPU core constantly busy

Environment

  • Hardware: Mac mini M4 (10 cores)
  • macOS 26.4.1
  • OpenClaw 2026.4.29 (a448042)
  • Plugins active: feishu, openclaw-lark, memory-core, kimi, deepseek, tokenjuice
  • MCP servers: 6 (zhipu web search/reader/zread, chrome-devtools-mcp, gbrain serve, zhipu-vision)

Observations

  • The total setInterval count from dist/ is approximately 50 anonymous callbacks
  • Trajectory files up to 50MB are being repeatedly parsed in timer callbacks
  • Disabling plugins (lossless-claw, memory-wiki) has minimal impact on CPU

Expected behavior

Gateway should not continuously consume 100% CPU on idle. Background maintenance should use lower-frequency polling or event-driven patterns.

extent analysis

TL;DR

Optimizing the timer callbacks and reducing the frequency of setInterval calls may help alleviate the high CPU usage issue.

Guidance

  • Review the 50 registered setInterval callbacks across various gateway components to identify opportunities for optimization or consolidation.
  • Investigate the heavy ArrayMap/ArrayFrom operations on session/trajectory data and consider using more efficient data structures or algorithms.
  • Limit the frequency of lstat calls by implementing a caching mechanism or reducing the number of filesystem scans.
  • Consider implementing a more efficient polling strategy, such as using event-driven patterns or lower-frequency polling, to reduce the cumulative effect of timer callbacks.

Example

No specific code snippet can be provided without more context, but an example of optimizing setInterval calls could involve increasing the interval time or using a more efficient scheduling library.

Notes

The issue may be specific to the Mac mini M4 hardware or the OpenClaw 2026.4.29 version, and further investigation is needed to determine the root cause. Disabling plugins had minimal impact on CPU usage, suggesting that the issue may be related to the core gateway functionality.

Recommendation

Apply a workaround by optimizing timer callbacks and reducing the frequency of setInterval calls, as the root cause of the issue is likely related to the cumulative effect of these callbacks.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Gateway should not continuously consume 100% CPU on idle. Background maintenance should use lower-frequency polling or event-driven patterns.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: 2026.4.29 gateway consumes 100% CPU on one core due to ~50 setInterval timers [3 comments, 4 participants]