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 usage #4145

Merged
merged 7 commits into from
Jun 26, 2023
Merged

Reduce memory usage #4145

merged 7 commits into from
Jun 26, 2023

Conversation

damip
Copy link
Member

@damip damip commented Jun 23, 2023

Contents

  • reduce the number of force-kept final periods to 5 (1min20s)
  • in protocol, when retrieving block ops, they were added to Storage but not to stored_operations so they were not cleaned by clear_storage => refactor this to not use self.storage, to make better use of Storage instances in general, and move the responsibility of keeping ops temporarily alive during propagation to the op propagation handler instead of the retrievers
  • box heavy elements in Storage to avoid huge allocations on HashMap growth
  • cap the number of operations kept for propagation
  • reduce the endorsement propagation time to 2 periods
  • make operation batch announcement more robust
  • achieve stable 3GB RAM usage at 4ktxps on testnet

Checklist

  • document all added functions
  • try in sandbox /simulation/labnet
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification
  • after merging in main, merge main to branch testnet24

@damip damip changed the title Box storeage allocations for memory reduction Reduce memory usage Jun 23, 2023
@damip damip requested a review from AurelienFT June 24, 2023 09:06
@damip damip self-assigned this Jun 25, 2023
Copy link
Contributor

@AurelienFT AurelienFT left a comment

Choose a reason for hiding this comment

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

How the ops storage wasn't growing with the leak on block handler. Anyway. Nice found and if tested on the testnet we can merge it.

@AurelienFT
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 26, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@damip damip merged commit d4974b3 into main Jun 26, 2023
@AurelienFT AurelienFT deleted the box_storage_allocs branch October 23, 2023 08:52
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