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

core: fix temp memory blowup caused by defers holding on to state #22319

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

karalabe
Copy link
Member

@karalabe karalabe commented Feb 12, 2021

When adding the background trie prefetcher, I've used defers to make sure the prefetchers are stopped irrelevant what error path the importer exits on. Learnt once again that defer in a loop is a horrible idea, because it kept references to old state imported in the same batch. On the Shanghai attack range, this caused a temporary memory blowup, which if enough blocks were imported in a single batch could cause a significant RAM spike.

Shoutout to Michael for finding this issue.

@karalabe karalabe added this to the 1.10.0 milestone Feb 12, 2021
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM!

@holiman
Copy link
Contributor

holiman commented Feb 12, 2021

Screenshot_2021-02-12 Dual Geth - Grafana
Looks good!

@karalabe
Copy link
Member Author

I think you didn't select this PR run on the charts, I only see the reference which blew :)

@karalabe
Copy link
Member Author

Ah, you compared vs previous runs.

@karalabe
Copy link
Member Author

Blue-green = master
Orange-red = PR

Screenshot from 2021-02-12 14-09-09

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