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

Copy node-cache entries to reduce mem usage #521

Merged
merged 7 commits into from
May 27, 2024
Merged

Conversation

HDegroote
Copy link
Contributor

Context: random-access-file uses slab-allocated memory by default when reading from disk. Since we store the nodes in a cache, the entire slab is kept from being garbage-collected. This PR copies the cache entry to a new, smaller slab.

lib/merkle-tree.js Outdated Show resolved Hide resolved
@HDegroote
Copy link
Contributor Author

HDegroote commented May 27, 2024

Marking as draft since there is a failing CI on windows I need to look into (seems like an interaction with tmp-test)

Edit: forgot to close the tree, so it was an error in the test itself. Fixed now

@HDegroote HDegroote marked this pull request as draft May 27, 2024 08:55
@HDegroote HDegroote marked this pull request as ready for review May 27, 2024 09:20
lib/merkle-tree.js Outdated Show resolved Hide resolved
@mafintosh mafintosh merged commit f51db0d into main May 27, 2024
4 checks passed
@mafintosh mafintosh deleted the copy-node-cache-entries branch May 27, 2024 11:11
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.

2 participants