From 67b7c5adc881a9cd84bcaf2d9ed0c35ce955b121 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 22 Jan 2015 00:41:06 +1100 Subject: [PATCH] dht: Reduce memory use --- dht/dht.go | 2 +- dht/getpeers.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dht/dht.go b/dht/dht.go index afc67dfe..06cdfcda 100644 --- a/dht/dht.go +++ b/dht/dht.go @@ -21,7 +21,7 @@ import ( "github.com/anacrolix/libtorgo/bencode" ) -const maxNodes = 10000 +const maxNodes = 1000 // Uniquely identifies a transaction to us. type transactionKey struct { diff --git a/dht/getpeers.go b/dht/getpeers.go index 31537cc6..c507809c 100644 --- a/dht/getpeers.go +++ b/dht/getpeers.go @@ -41,7 +41,7 @@ func (s *Server) GetPeers(infoHash string) (*peerStream, error) { stop: make(chan struct{}), values: make(chan peerStreamValue), }, - triedAddrs: bloom.NewWithEstimates(10000, 0.01), + triedAddrs: bloom.NewWithEstimates(1000, 0.5), server: s, infoHash: infoHash, } -- 2.48.1