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

Issue 330: Support removeDocument from synchronizer and isDocSubscribedTo #366

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

georgewsu
Copy link
Contributor

Summary:
Add support for removeDocument from synchronizer so that we can start evicting doc handles from Repo handleCache.
Add support for isDocSubscribedTo so that we only evict doc handles that don't have any subscribed peers.

Issue:
#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:
#365

Part 2:
This PR only covers introducing removeDocument and isDocSubscribedTo so that in the next PR we can evict doc handles from Repo handleCache.

@georgewsu georgewsu marked this pull request as ready for review July 30, 2024 22:35
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