This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 00dc67c
1 parent a6a1dbc commit 00dc67c Copy full SHA for 00dc67c
File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
22
22
wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
23
23
peer "github.com/ipfs/go-ipfs/p2p/peer"
24
24
"github.com/ipfs/go-ipfs/thirdparty/delay"
25
+ u "github.com/ipfs/go-ipfs/util"
25
26
logging "github.com/ipfs/go-ipfs/vendor/QmQg1J6vikuXF9oDvm4wpdeAUvvkVEKW1EYDw9HhTMnP2b/go-log"
26
27
)
27
28
@@ -39,12 +40,22 @@ const (
39
40
sizeBatchRequestChan = 32
40
41
// kMaxPriority is the max priority as defined by the bitswap protocol
41
42
kMaxPriority = math .MaxInt32
43
+ )
42
44
45
+ var (
43
46
HasBlockBufferSize = 256
44
47
provideKeysBufferSize = 2048
45
48
provideWorkerMax = 512
46
49
)
47
50
51
+ func init () {
52
+ if u .LowMemMode {
53
+ HasBlockBufferSize = 64
54
+ provideKeysBufferSize = 512
55
+ provideWorkerMax = 16
56
+ }
57
+ }
58
+
48
59
var rebroadcastDelay = delay .Fixed (time .Second * 10 )
49
60
50
61
// New initializes a BitSwap instance that communicates over the provided
You can’t perform that action at this time.
0 commit comments