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: OOM on large DAGs #410

Merged
merged 5 commits into from
Sep 21, 2022
Merged

fix: OOM on large DAGs #410

merged 5 commits into from
Sep 21, 2022

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 15, 2022

Storing a set of seen CIDs to short-cut DAG traversal while ensuring we have all the blocks in a DAG in the blockstore can cause OOMs for very large DAGs so replace the unbounded Set with a LRU cache with a configurable maximum size.

Storing a set of seen CIDs to short-cut DAG traversal while ensuring
we have all the blocks in a DAG in the blockstore can cause OOMs for
very large DAGs.
@BigLep
Copy link

BigLep commented Sep 15, 2022

How easy is it to add a regression test?

@achingbrain
Copy link
Member Author

achingbrain commented Sep 16, 2022

I'm removing an optimisation that doesn't appear to have had a specific test for it - I should really be deleting a test here..

The optimisation is now retained but we use a LRU cache instead of an unbounded Set.

Refactor to use a lru cache instead of an unbounded set and add a
test to make sure the cache actually caches things.
@achingbrain achingbrain merged commit 336d0b9 into master Sep 21, 2022
@achingbrain achingbrain deleted the fix/oom-in-dag-traversal branch September 21, 2022 16:30
github-actions bot pushed a commit that referenced this pull request Sep 21, 2022
## [ipfs-repo-migrations-v13.0.3](ipfs-repo-migrations-v13.0.2...ipfs-repo-migrations-v13.0.3) (2022-09-21)

### Bug Fixes

* OOM on large DAGs ([#410](#410)) ([336d0b9](336d0b9))

### Dependencies

* update @multiformats/multiaddr to 11.0.0 ([#411](#411)) ([f7b34eb](f7b34eb))
@github-actions
Copy link

🎉 This PR is included in version ipfs-repo-migrations-v13.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Sep 21, 2022
## [ipfs-repo-v15.0.3](ipfs-repo-v15.0.2...ipfs-repo-v15.0.3) (2022-09-21)

### Bug Fixes

* OOM on large DAGs ([#410](#410)) ([336d0b9](336d0b9))
@github-actions
Copy link

🎉 This PR is included in version ipfs-repo-v15.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants