Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s3ng: Provide objectSize when uploading
According to the documentation for `PutObject`, setting objectSize to -1 causes a multipart Put operation until the input stream reaches EOF, which can result in high memory usage. Something similar has already been reported in minio/minio-go#1496 This PR changes the behavior so it tries to determine the file size before uploading it. Should the given io.Reader not be a file, it falls back to using `-1`. In my testing this change has reduced the memory usage when uploading files to OICS quite a bit: From over 1GB for a single user, down to <300MB.
- Loading branch information