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

Reduce memory use during Archive Sync #7407

Merged
merged 8 commits into from
Sep 11, 2024
Merged

Reduce memory use during Archive Sync #7407

merged 8 commits into from
Sep 11, 2024

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Sep 10, 2024

Changes

  • TxTries and ReceiptTries don't do any pruning so don't need the ConcurrentDictionaries allocated just for Calculating roots
image
  • Lazy allocate ConcurrenctDictionaries (+DirtyNodes in Trie)
  • Change class => struct
  • NodeKey class => struct
  • Force GCs on archive sync

Seen when processing archive nodes (many blocks at once)

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

Copy link
Contributor

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! LastSeen is not needed at all for receipts and transactions. :)

Was it the reason for the memory leak?

I think TrieStore could be simplified significantly for receipts and transactions

@benaadams benaadams changed the title Only allocate persistence dictionary for pruning tries Reduce memory use during Archive Sync Sep 11, 2024
@benaadams
Copy link
Member Author

Was it the reason for the memory leak?

Yes is doing 400 blk/s so doing the block allocations at a far faster rate; plus since its not going via newPayload it doesn't trigger the GCKeeper so we don't trigger the memory release GCs (GC decides we need that memory due to the high allocation rate) or the MallocTrims

@benaadams benaadams merged commit 73b10fb into master Sep 11, 2024
69 checks passed
@benaadams benaadams deleted the trie-allocations branch September 11, 2024 09:36
rjnrohit pushed a commit that referenced this pull request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants