libp2p / go-libp2p-kad-dht

A Kademlia DHT implementation on go-libp2p
https://github.com/libp2p/specs/tree/master/kad-dht
MIT License
516 stars 220 forks source link

IpfsDHT.GatValue method causes memory growth #958

Closed godeamon closed 7 months ago

godeamon commented 7 months ago
image

This flame graph is the memory graph where I keep calling the GatValue method. If I keep calling, the memory keeps going up. Here is my code: https://github.com/OpenAtomFoundation/xupercore/blob/v5.3.0/bcs/network/p2pv2/server.go#L362C29-L362C29

I'm not sure if I'm using it the wrong way or if there's a memory leak.

github.com/libp2p/go-libp2p-kad-dht v0.25.1 also has this problem.

godeamon commented 7 months ago

PR: https://github.com/libp2p/go-libp2p-kad-dht/pull/960