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

feat(SwingSet): Report vat snapshot size delta on save #10935

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

siarhei-agoric
Copy link
Contributor

closes: #10910

Description

Two changes:
1. move slog 'heap-snapshot-save' from vatKeeper.js to manager-subprocess-xsnap.js
2. track uncompressedSizeLoaded in a local variable inside createFromBundle()
   and report delta from makeSnapshot()

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

heap-snapshot-save slog entry now has a new uncompressedSizeDelta property representing the change in snapshot size in bytes at snapshot save time if a vat had been loaded from a snapshot. uncompressedSizeDelta is null if a vat had been started from a bundle without snapshot loaded.

Testing Considerations

Need to confirm that:

  • uncompressedSizeDelta is present in all heap-snapshot-save slog entries
  • null when no snapshot loaded
  • reflects the actual changes of snapshot size

Upgrade Considerations

None.

Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

LGTM after a little tweaking.

Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 60eab22
Status: ✅  Deploy successful!
Preview URL: https://068dfe19.agoric-sdk.pages.dev
Branch Preview URL: https://sliakh-10910-report-heap-sna.agoric-sdk.pages.dev

View logs

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.

I love that we're moving the heap snapshot slogging in a single place.

I think that if restartWorker is true, the delta will currently remain null (or stale) because we're never updating it with the size of the snapshot taken.

Also I guess the delta metric got stuck in the keyboard since it's not reported in the slog event ;)

siarhei-agoric and others added 5 commits February 7, 2025 15:53
Two changes:
1. move slog 'heap-snapshot-save' from vatKeeper.js to manager-subprocess-xsnap.js
2. track uncompressedSizeLoaded in a local variable inside createFromBundle()
   and report delta from makeSnapshot()
move uncompressedSizeLoaded into saveSnapshot().
@siarhei-agoric siarhei-agoric force-pushed the sliakh-10910-report-heap-snapshot-size-delta branch from f493ed3 to 60eab22 Compare February 7, 2025 20:53
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.

Missed the snapshotStream bug. Thankfully our CI was screaming about it.

const results = await snapStore.saveSnapshot(
vatID,
snapPos,
snapshotStream,
Copy link
Member

Choose a reason for hiding this comment

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

I totally missed that here. We cannot use snapshotStream here but must use a stream provided as argument, which in the case of restartWorker would be snapStoreSaveStream, a tee of the original snapshotStream.

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.

Report heap snapshot size delta
3 participants