Skip to content

fix: preserve forkserver copy-on-write sharing - #7120

Merged
chenghao-mou merged 2 commits into
mainfrom
chenghao/fix/AGT-3441-preserve-forkserver-cow
Sep 4, 2026
Merged

fix: preserve forkserver copy-on-write sharing#7120
chenghao-mou merged 2 commits into
mainfrom
chenghao/fix/AGT-3441-preserve-forkserver-cow

Conversation

@chenghao-mou

Copy link
Copy Markdown
Member

Why: Full cyclic GC in a job process writes to inherited GC metadata and turns forkserver-shared heap pages private.

Behavior: Freeze completed preloads before forking. Tests protect ordering and child cycle collection.

Clarification: Use Shared_Dirty and PSS, not Shared_Clean; the cost varies with preloaded plugins.

Credit: Supersedes #7118 by @Darshak03, credited as a commit co-author.

Fixes #7117
Addresses AGT-3441

Initial prompt and agent context

Model: GPT-5.6

can you investigate issue 7117?

we don't have similar issue in Node js, right?

Okay, let's create a new PR for this with the original PR author credited as co-author so that we can bring in the regression tests and clarification.

run a subagent with $thermo-nuclear-code-quality-review and $code-taste-review before commit or PR.

Freeze forkserver-preloaded Python objects before job processes fork so child GC scans do not make inherited heap pages private. Add regression coverage for preload ordering and child garbage collection.

Co-authored-by: Darshak Jankat <darshak.jankat@unifyapps.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@chenghao-mou
chenghao-mou merged commit 7a7cdaf into main Sep 4, 2026
24 checks passed
@chenghao-mou
chenghao-mou deleted the chenghao/fix/AGT-3441-preserve-forkserver-cow branch September 4, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

forkserver preload's COW sharing is destroyed by the GC in each job process (~96MB per idle worker)

2 participants