mirror of https://github.com/minio/minio.git
XL/erasure: Reset dataBlocks to reduce the memory usage. (#1749)
Fixes #1748
This commit is contained in:
parent
1e393c6c5b
commit
a97230dd56
|
@ -147,6 +147,9 @@ func (e erasure) ReadFile(volume, path string, startOffset int64, totalSize int6
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset dataBlocks to relenquish memory.
|
||||||
|
dataBlocks = nil
|
||||||
|
|
||||||
// Reset offset to '0' to read rest of the blocks.
|
// Reset offset to '0' to read rest of the blocks.
|
||||||
startOffset = int64(0)
|
startOffset = int64(0)
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
// getDataBlocks - fetches the data block only part of the input encoded blocks.
|
// getDataBlocks - fetches the data block only part of the input encoded blocks.
|
||||||
func getDataBlocks(enBlocks [][]byte, dataBlocks int, curBlockSize int) []byte {
|
func getDataBlocks(enBlocks [][]byte, dataBlocks int, curBlockSize int) (data []byte) {
|
||||||
var data []byte
|
|
||||||
for _, block := range enBlocks[:dataBlocks] {
|
for _, block := range enBlocks[:dataBlocks] {
|
||||||
data = append(data, block...)
|
data = append(data, block...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue