Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xsnap): Avoid snapshot data memory leak #9405

Merged
merged 6 commits into from
May 28, 2024

Conversation

gibson042
Copy link
Member

@gibson042 gibson042 commented May 23, 2024

Fixes #9316

Description

Add testing code to observe memory leaks related to xsnap snapshots, and fix the leak that retains them.

Security Considerations

None.

Scaling Considerations

None.

Documentation Considerations

None.

Testing Considerations

Covered!

Upgrade Considerations

None (this is kernel code).

@gibson042 gibson042 requested a review from mhofman May 23, 2024 18:21
Copy link

cloudflare-workers-and-pages bot commented May 23, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: c9db8f8
Status: ✅  Deploy successful!
Preview URL: https://56ffe750.agoric-sdk.pages.dev
Branch Preview URL: https://gibson-9316-xsnap-snapshot-m.agoric-sdk.pages.dev

View logs

@gibson042 gibson042 force-pushed the gibson-9316-xsnap-snapshot-memory-leak branch 2 times, most recently from 275a050 to 0461c7f Compare May 24, 2024 18:05
@gibson042 gibson042 changed the title test(xsnap): Add code for observing snapshot-related memory leaks fix(xsnap): Avoid snapshot data memory leak May 24, 2024
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

LGTM. Given the scope of fixups, I'm not sure mergify will be able to do it right, so feel free to rebase locally. I'd love to keep the layering of failing test -> fix with test switching to non failing.

@@ -33,6 +33,7 @@
"@endo/bundle-source": "^3.2.3",
"@endo/eventual-send": "^1.2.2",
"@endo/init": "^1.1.2",
"@endo/nat": "^5.0.7",
Copy link
Member

Choose a reason for hiding this comment

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

This should be in devDependencies

@@ -87,7 +157,7 @@ export async function xsnap(options) {
netstringMaxChunkSize = undefined,
parserBufferSize = undefined,
snapshotStream,
Copy link
Member

@mhofman mhofman May 25, 2024

Choose a reason for hiding this comment

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

Given our findings in https://gist.github.com/mhofman/7fbfd71048148b97089993bb4463b465 I am slightly conflicted about keeping this snapshotStream binding in the surrounding scope of makeSnapshotStream, but then the only major engine that seems to not support split scopes (JSC) would also need options to be nulled too, or skipped altogether (deconstructed in the params)

@gibson042 gibson042 force-pushed the gibson-9316-xsnap-snapshot-memory-leak branch from 0461c7f to 63cbd93 Compare May 25, 2024 05:07
@gibson042 gibson042 force-pushed the gibson-9316-xsnap-snapshot-memory-leak branch from 63cbd93 to c9db8f8 Compare May 28, 2024 13:23
@gibson042 gibson042 added the automerge:rebase Automatically rebase updates, then merge label May 28, 2024
@mergify mergify bot merged commit 4cdca36 into master May 28, 2024
71 checks passed
@mergify mergify bot deleted the gibson-9316-xsnap-snapshot-memory-leak branch May 28, 2024 13:59
mhofman pushed a commit that referenced this pull request May 30, 2024
Fixes #9316

Add testing code to observe memory leaks related to xsnap snapshots, and
fix the leak that retains them.

None.

None.

None.

Covered!

None (this is kernel code).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak in cosmic-swingset causes validator missed block
2 participants