fix: limit manual GC to bigger objects (#4581)
This commit is contained in:
@@ -195,7 +195,10 @@ func (p *ParallelManager) enoughMemForUpload(uploadSize int64) bool {
|
||||
}
|
||||
|
||||
smem := runtime.MemStats{}
|
||||
runtime.GC()
|
||||
if uploadSize > 50<<20 {
|
||||
// GC if upload is bigger than 50MB.
|
||||
runtime.GC()
|
||||
}
|
||||
runtime.ReadMemStats(&smem)
|
||||
|
||||
return estimateNeededMemoryForUpload(uploadSize)+smem.Alloc < p.maxMem
|
||||
|
||||
Reference in New Issue
Block a user