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

trie: don't report the root flushlist as an alloc #16945

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

karalabe
Copy link
Member

@karalabe karalabe commented Jun 11, 2018

Fixes #16907.

The trie database (memcache) has a method to retrieve the currently consumed memory. When adding the streaming GC, I modified it so it also reports the size of the doubly-linked flushlist, which we use to flush out old data first.

There was a slight error in this reporting. The trie database has a root node (unkeyed), which acts as the singleton parent for all tries to ensure correct GC. The flushlist size was reported as the number of nodes * 2 hashes. The root node however is a metanode that's never destroyed, so if we count this node too into the flushlist size, the trie database will always report a non-zero size (64 bytes when empty).

This caused the blockchain to always print an ERROR log on exit, reporting that GC is faulty due to non-zero memory use after cleanup. The memory use however was only the root metanode. This PR fixes the size reporting so that it doesn't count the metanode any more into this group.

@karalabe karalabe requested a review from holiman June 11, 2018 11:37
@karalabe karalabe modified the milestone: 1.8.11 Jun 11, 2018
@karalabe karalabe merged commit 43b940e into ethereum:master Jun 11, 2018
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.

Dangling trie nodes after full cleanup
2 participants