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

transport-manager: Fix memory leak by bounding the number of tracked peers #268

Open
lexnv opened this issue Oct 22, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@lexnv
Copy link
Collaborator

lexnv commented Oct 22, 2024

Currently, the transport manager never removes the state of disconnected peers.

This leads to increasing memory consumption over time, especially considering that each peer state supports up to 64 addresses.

We would still need to keep disconnected peers around for a sensible amount of time because the peer state provides us with the addresses to dial peers.

One possible solution that takes into account preserving addresses:

  • extend PeerState::Disconnected with a timestamp; whenever the peer disconnects we keep track of time
  • periodically (tbd N minutes 1h) remove disconnected peers who are disconnected for more than N minutes

Total number of tracked addresses

Screenshot 2024-10-22 at 12 39 27

Total number of tracked peers

Screenshot 2024-10-22 at 12 38 16

cc @paritytech/networking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant