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

Avoid keeping references to local op metadata in pending state manager #21135

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

Abe27342
Copy link
Contributor

Description

We currently store the entire pending message in savedOps despite not needing its local op metadata at usage. We noticed this memory leak in some SharedTree usage, which puts a copy of the tree's schema in local op metadata (schema has cheap copy, but still seemed reasonable to fix).

@github-actions github-actions bot added area: runtime Runtime related issues base: main PRs targeted against main branch labels May 16, 2024
@Abe27342
Copy link
Contributor Author

Abe27342 commented May 16, 2024

TODO this needs a test.

I also wonder if we can do any better than only clearing savedOps entirely on resubmit.

edit: Thought a bit about writing a test for this, but not sure it's worth making an access violation or restructuring pending state manager to expose this bit. as-is, the change is only observable via memory pressure. So not super high stakes if we ever regress. Going to omit it and just check this in.

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented May 17, 2024

@fluid-example/bundle-size-tests: +84 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 453.27 KB 453.29 KB +21 Bytes
azureClient.js 552.58 KB 552.6 KB +21 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 256.97 KB 256.99 KB +21 Bytes
fluidFramework.js 366.42 KB 366.42 KB No change
loader.js 134.46 KB 134.46 KB No change
map.js 41.46 KB 41.46 KB No change
matrix.js 143.75 KB 143.75 KB No change
odspClient.js 520.95 KB 520.97 KB +21 Bytes
odspDriver.js 97.3 KB 97.3 KB No change
odspPrefetchSnapshot.js 42.16 KB 42.16 KB No change
sharedString.js 160.27 KB 160.27 KB No change
sharedTree.js 366.41 KB 366.41 KB No change
Total Size 3.21 MB 3.21 MB +84 Bytes

Baseline commit: 9b954e6

Generated by 🚫 dangerJS against e87bb93

@anthony-murphy
Copy link
Contributor

anthony-murphy commented May 17, 2024

I also wonder if we can do any better than only clearing savedOps entirely on resubmit.

We can't today, as on replay we assume the client id of the client who's ops we stashed, so we need to replay all the ops of that client even if they were ack'd

@Abe27342 Abe27342 enabled auto-merge (squash) June 4, 2024 20:41
@Abe27342 Abe27342 merged commit cb60521 into microsoft:main Jun 4, 2024
30 checks passed
@Abe27342 Abe27342 deleted the dont-save-localopmetadata branch June 4, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: runtime Runtime related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants