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

Known Memory Leaks #715

Closed
Stebalien opened this issue Sep 3, 2019 · 1 comment
Closed

Known Memory Leaks #715

Stebalien opened this issue Sep 3, 2019 · 1 comment
Labels
kind/bug A bug in existing code (including security flaws) topic/meta Topic meta

Comments

@Stebalien
Copy link
Member

Stebalien commented Sep 3, 2019

This issue exists to track known memory leaks and their statuses. A memory leak is defined as a case where memory grows unbounded (intentionally or not) over time.

Peerstore

The peerstore is currently stored in memory by default and not all values are garbage collected.

For every peer we've ever connected to, we remember:

  • Known protocols (medium)
  • Public keys (medium)
  • Peer IDs (minor)
  • User agents/versions (minor)

For recently connected peers, we remember (not technically a leak as we do GC eventually):

  • All addresses reported by that peer (could be quite a few).

Solutions:

Metrics

We collect bandwidth (and other) metrics that we don't always do a good job of cleaning up.

  • For every protocol we've ever spoken, we remember how much bandwidth the protocol has used. (negligible for now)
  • For every peer we've connected to, we remember how much bandwidth (in/out) the peer has used. (minor)

Solutions:

  • Metrics can be entirely disabled in the libp2p constructor.
  • We could implement a sweeper that removes metrics that haven't been touched in some time period.

Libp2p team: Please update this as we find new issues and resolve old ones.

@marten-seemann
Copy link
Contributor

This was fixed in the v0.17.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/meta Topic meta
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants