]> Sergey Matveev's repositories - btrtrc.git/commitdiff
dht: Reduce memory use
authorMatt Joiner <anacrolix@gmail.com>
Wed, 21 Jan 2015 13:41:06 +0000 (00:41 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 21 Jan 2015 13:41:06 +0000 (00:41 +1100)
dht/dht.go
dht/getpeers.go

index afc67dfe9669bac4f764f3df964d25f06798ddd5..06cdfcdae47045a834e6e700d35c204f1afef458 100644 (file)
@@ -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 {
index 31537cc67b75f234fad6fa7ad3792c16dc590040..c507809c207572cdbdf169bb3cd72064d503ac7e 100644 (file)
@@ -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,
        }