Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Update go-libp2p-kad-dht to fix memory leak #539

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Conversation

albrow
Copy link
Contributor

@albrow albrow commented Nov 18, 2019

This is a potential solution to #452. Memory snapshots revealed that go.opencensus.io/tag.(*Map).insert was responsible for an unusually large amount of memory (up to 100MB after a few days). That package is used by github.com/libp2p/go-libp2p-kad-dht. libp2p/go-libp2p-kad-dht#389 mentions this leak which was reported as fixed in version 0.2.1.

This PR updates github.com/libp2p/go-libp2p-kad-dht to the latest version. We will need to continue to monitor memory usage to see if this fixes the problem.

@@ -319,13 +319,6 @@ func (n *Node) ID() peer.ID {
// Start causes the Node to continuously send messages to and receive messages
// from its peers. It blocks until an error is encountered or `Stop` is called.
func (n *Node) Start() error {
// Note: dht.Bootstrap has a somewhat confusing name. It doesn't automatically
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calling Bootstrap is no longer necessary in the latest version of go-libp2p-kad-dht. See https://github.com/libp2p/go-libp2p-kad-dht/releases/tag/v0.3.0.

@albrow albrow merged commit a224600 into development Nov 18, 2019
@albrow albrow deleted the fix/upgrade-dht branch November 18, 2019 23:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants