Closed gadelkareem closed 4 years ago
Where are you deriving the heap allocation value? Often people conflate the virtual and resident memory usage, I want to rule that out.
it is the default stackimpact allocation https://stackimpact.com/blog/go-profiler-internals/
Okay that makes sense. It's likely due to query rate limiting due to the conntrack implementation. I intend to redesign this sometime. In the meanwhile, try calling SetNoMaxEntries
and setting Timeout
to a function that returns zero duration on the ConnectionTracking
field in the dht ServerConfig
for your instance.
I made some tests using github.com/shiyanhui/dht and the memory/CPU usage is much lower.
@gadelkareem try again now with the latest version of anacrolix/dht
.
Thanks @anacrolix will let you know when I get the time.
If this isn't fixed by previous changes, https://github.com/anacrolix/dht/commit/8f69499a9cd0dfd8bf846abe05bda3f17197561d will most certainly do it.
See v1.5.0
.
I limited the requests to 10 concurrent requests to the DHT server and dropped the torrent from the client after collecting the metainfo:
Yet the memory usage gets up to 2GB in its peak. Here is a sample from stackimpact:
Is it normal that the communication requires that much ram? Could it be a problem with the bencode serialisation?