Skip to content

cmd: fix memory leak when big dataset#2455

Merged
zzzckck merged 2 commits intobnb-chain:developfrom
fynnss:fix_inspect_trie_memory_leak
May 15, 2024
Merged

cmd: fix memory leak when big dataset#2455
zzzckck merged 2 commits intobnb-chain:developfrom
fynnss:fix_inspect_trie_memory_leak

Conversation

@fynnss
Copy link
Copy Markdown
Contributor

@fynnss fynnss commented May 14, 2024

Description

This pr fix memory leak when inspect trie with big dataset(more than 300M account and 100M contract)

Rationale

Bug fix for memory leak

Example

./geth db inspect-trie latest 5000 10

This command will inspect the latest state tree with a concurrency of 5000 trie, and finally print out the account tree and top 10 contract tree statistics.

Changes

Notable changes:

  • add topN for print top n storage trie
  • refactor for calc topN
  • fix memory leak

@fynnss fynnss force-pushed the fix_inspect_trie_memory_leak branch from 3f572c0 to 3d259e3 Compare May 14, 2024 03:43
@fynnss fynnss changed the title cmd: refactor inspect-trie and fix memory leak when big dataset cmd: fix memory leak when big dataset May 14, 2024
@fynnss fynnss changed the base branch from master to develop May 14, 2024 03:48
@fynnss fynnss force-pushed the fix_inspect_trie_memory_leak branch from 3d259e3 to 21c176c Compare May 14, 2024 03:48
@fynnss fynnss force-pushed the fix_inspect_trie_memory_leak branch from 93bfdf6 to bb38b1f Compare May 14, 2024 06:38
Copy link
Copy Markdown

@RenRick RenRick left a comment

Choose a reason for hiding this comment

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

LGTM

@zzzckck zzzckck merged commit b230a02 into bnb-chain:develop May 15, 2024
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.

3 participants