mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
sync: free objects after they come out of the transfer pipe
This reduces memory when the transfer pipe shrinks See: https://forum.rclone.org/t/rclone-memory-consumption-increasing-linearly/12244
This commit is contained in:
parent
e337cae0c5
commit
543100070a
@ -68,7 +68,10 @@ func (p *pipe) Get(ctx context.Context) (pair fs.ObjectPair, ok bool) {
|
||||
}
|
||||
}
|
||||
p.mu.Lock()
|
||||
pair, p.queue = p.queue[0], p.queue[1:]
|
||||
pair = p.queue[0]
|
||||
p.queue[0].Src = nil
|
||||
p.queue[0].Dst = nil
|
||||
p.queue = p.queue[1:]
|
||||
size := pair.Src.Size()
|
||||
if size > 0 {
|
||||
p.totalSize -= size
|
||||
|
Loading…
Reference in New Issue
Block a user