Skip to content

Fix memory leak in repair/upload code

Christopher Schinnerl requested to merge download-clear-data into master

Created by: ChrisSchinnerl

Previously the logicalChunkData of an unfinishedUploadChunk was a simple byte slice that was erasure coded into the shards/pieces that are eventually distributed across many hosts. The problem is, that this slice is a single allocated block of memory. This means we can't free the memory for individual shards before all the pieces using this memory are uploaded. This PR changes the logicalChunkData to a [][]byte slice and makes sure that every []byte in it was allocated separately.

Merge request reports