Connectd memleak fix#5312
Merged
rustyrussell merged 5 commits intoElementsProject:masterfrom Jun 17, 2022
Merged
Conversation
1abeb3f to
ea98832
Compare
Collaborator
|
I'm now running my node with this patch (PR through ea98832), and it's looking good. It may be too early to say yet, but I am not seeing the continual run-up in memory usage by |
Collaborator
|
It's still looking great. I'd call this one licked. |
When we moved gossip filtering to connectd, this aging got lost. Without this, we hit the 10,000 entry limit before expiring full gossip anti-echo cache. This is under 1M in allocations per peer, but in DEVELOPER mode each allocation includes adds 3 notifiers (32 bytes each) and a backtrace child (40 + 40 + 256 bytes), making it almost 10MB per peer, plus allocation overhead. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: connectd: large memory usage with many peers fixed.
channeld is the only user of these functions, since it now streams all gossip itself. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It was doing its own equivalent check anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Instead of doing an allocation per entry, put the entry in directly. This means only 30 bit resolution on 32-bit machines, but if a bit of gossip gets accidently suppressed that's ok. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10,000 per peer was too much. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
e2ec262 to
1807be7
Compare
Contributor
Author
|
Ack 1807be7 Removed one overzealous commit, added Changelog message. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This may not be the only leak, but it's one.
Reported-by: @whitslack