mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
s3: fix excess memory usage when using versions
Before this change, we were taking the version ID straight from the XML blob returned by the SDK and thus pinning the XML into memory which bulked up the average memory per object from about 400 bytes to 4k. Copying the string fixes the excess memory usage.
This commit is contained in:
parent
c446651be8
commit
43bf177ff7
|
@ -3093,7 +3093,7 @@ func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *s3.Obje
|
|||
o.setMD5FromEtag(aws.StringValue(info.ETag))
|
||||
o.bytes = aws.Int64Value(info.Size)
|
||||
o.storageClass = stringClonePointer(info.StorageClass)
|
||||
o.versionID = versionID
|
||||
o.versionID = stringClonePointer(versionID)
|
||||
} else if !o.fs.opt.NoHeadObject {
|
||||
err := o.readMetaData(ctx) // reads info and meta, returning an error
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user