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

Add support for clearing doc from DocHandle #1

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

georgewsu
Copy link
Owner

Summary:
Add support for clearing doc from DocHandle so that reference can be released and memory freed, without deleting document from storage

Issue:
automerge#330

Background:
After creating enough documents in a repo, out of memory errors will cause a synch server to crash because memory isn't being freed. Repo holds references to each DocHandle in handleCache and each DocHandle holds a reference to the automerge doc.

Proposed solution:
https://github.com/georgewsu/automerge-repo/tree/gsu/cache-eviction-test2 has code for an initial implementation of cache eviction and releasing document reference so that memory can be freed. I've tested this with a sync server running locally.

Part 1:
This PR only covers introducing a new state and event to DocHandle to allow clearing the document.

…released and memory freed, without deleting document from storage
@georgewsu georgewsu merged commit 8dbc3aa into main Aug 1, 2024
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