-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Managed memory dreaming cron can overload gateway under pressure #84847
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Managed memory dreaming cron can sweep many workspaces in one gateway tick, keeping the gateway under memory and CPU pressure instead of yielding background work.
Steps to reproduce
Expected behavior
Managed background memory dreaming should avoid adding substantial gateway pressure: cron-triggered work should be bounded per tick and deferred when RSS or heap pressure is already high.
Actual behavior
Observed logs show one managed dreaming cron tick processing 10 workspaces and taking 69621 ms while nearby diagnostics reported high memory pressure and a saturated event loop.
OpenClaw version
NOT_ENOUGH_INFO
Operating system
NOT_ENOUGH_INFO
Install method
NOT_ENOUGH_INFO
Model
NOT_ENOUGH_INFO
Provider / routing chain
NOT_ENOUGH_INFO
Additional provider/model setup details
NOT_ENOUGH_INFO
Logs, screenshots, and evidence
memory-core: dreaming promotion complete (workspaces=10, candidates=10, applied=1, failed=0) observed managed background task duration: 69621ms memory pressure warning: rssBytes=1827979264 heapUsedBytes=684072312 thresholdBytes=1610612736 liveness warning: eventLoopUtilization=0.991 cpuCoreRatio=1.107 active=0 waiting=0 queued=0Impact and severity
Affected: gateways with memory-core short-term dreaming enabled across multiple workspaces.
Severity: high for responsiveness when background memory work overlaps active gateway load.
Frequency: observed during managed dreaming cron execution.
Consequence: background memory promotion can consume gateway time and memory during normal operation, contributing to delayed or saturated agent handling.
Additional information
The attached fix bounds managed cron dreaming to a small rotating workspace batch, defers cron-triggered dreaming when process RSS or heap pressure is above warning thresholds, and applies the same cron guard to queued managed heartbeat delivery.