avoid pre-populating buffers for deployments < 32GiB memory (#19839)

This commit is contained in:
Harshavardhana
2024-05-30 04:58:12 -07:00
committed by GitHub
parent aad50579ba
commit 4af31e654b
7 changed files with 58 additions and 33 deletions

View File

@@ -104,7 +104,11 @@ func newErasureServerPools(ctx context.Context, endpointServerPools EndpointServ
// Initialize byte pool once for all sets, bpool size is set to
// setCount * setDriveCount with each memory upto blockSizeV2.
buffers := bpool.NewBytePoolCap(n, blockSizeV2, blockSizeV2*2)
buffers.Populate()
if n >= 16384 {
// pre-populate buffers only n >= 16384 which is (32Gi/2Mi)
// for all setups smaller than this avoid pre-alloc.
buffers.Populate()
}
globalBytePoolCap.Store(buffers)
var localDrives []StorageAPI