Skip to content

fix(jsc): preserve generational worker heap collection on main - #15

Draft
steipete wants to merge 1 commit into
openclaw/mainfrom
fix/worker-gc-cadence-main
Draft

steipete wants to merge 1 commit into
openclaw/mainfrom
fix/worker-gc-cadence-main

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown

Qualification hold: this companion still contains the earlier cadence policy. Its matching eight-CPU/four-worker measurements reduced providers wall time but regressed messaging wall time. The bounded-growth follow-up is under qualification in #14; this main-line companion will be updated only after the revised policy is accepted. Do not land the earlier candidate independently.

Main-line companion to #14. The five changed engine C++ source/header files are byte-identical to the release-line candidate. Main retains its own qualification layout and explicitly requires the cadence regression in its native workflow.

Worker heap limits currently force the next automatic collection to be full and collapse the whole-heap growth target to the nursery allowance. Repeated maintenance and allocation requests consequently retrace large surviving code graphs instead of using normal young-generation collection.

Preserve the normal full-heap growth target and bound allocation pacing separately. A conservative GC-boundary managed-memory estimate requests full verification when the old-generation budget may be exhausted. The existing post-full survivor OOM decision remains authoritative. A checked snapshot of full-collection buffer accounting preserves ArrayBuffer exclusion across Eden collections. Mandatory verification drives its existing collection ticket while idle, even when the optional stop timer is disabled.

Include the matching Bun immediate-timer wake adapter in both qualification paths, add worker cadence and parked-budget regression coverage, and require the new JSC regression in native selectors. Cache-data semantics, source identity, debugger behavior and public memory-accounting APIs are unchanged.

Instrumentation on a frozen four-worker workload attributes 726 of 746 providers full collections to automatic maintenance/allocation requests forced full by the existing policy. A prototype on that frozen engine reduces providers to 78 full collections and messaging to 45, with identical complete test outcomes. These diagnostic counts are not ordinary performance measurements: retained memory rises, and clean ThinLTO timing/memory qualification is still pending. No marker-policy change is included.

Validation so far: the JSC cadence regression fails on the unfixed helper-enabled control and passes on the prototype; paired worker resource tests pass 31/31, and surrounding Worker/VM/V8 tests pass 604 with zero failures. The complete main-line port received a clean isolated P2 review. Native release-line qualification, exact-head fork CI and controlled runtime comparisons remain pending. This draft does not request artifact publication.

@socket-security

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant