Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARN: 500 MB memory allocation not addressed in documentation for Client.PutObject #1478

Closed
sdhoward opened this issue Apr 13, 2021 · 6 comments
Labels

Comments

@sdhoward
Copy link

https://pkg.go.dev/github.com/minio/minio-go/v7#Client.PutObject

- For size input as -1 PutObject does a multipart Put operation
  until input stream reaches EOF. Maximum object size that can
  be uploaded through this operation will be 5TiB.

Related to #1473, please clarify that if the size is not specified, it will be assumed to be 5TB, each chunk will be assumed to be 500 MB, and that >500 MB will be allocated per upload.

@sdhoward sdhoward changed the title documentation for Client.PutObject doesn't warn about 500 MB memory allocation WARN: 500 MB memory allocation not addressed in documentation for Client.PutObject Jul 10, 2021
@creker
Copy link

creker commented Aug 17, 2021

The bigger problem I think is that buffers are not pooled.

@harshavardhana
Copy link
Member

The bigger problem I think is that buffers are not pooled.

You can't pool random buffers @creker you can control the buffer size using PartSize

@creker
Copy link

creker commented Aug 17, 2021

@harshavardhana you can, you did that in the previous version of the library. Then it was removed which was a mistake I think. PartSize helps but it's not enough. Not pooling buffers still causes unnecessary load on the GC.

@harshavardhana
Copy link
Member

@harshavardhana you can, you did that in the previous version of the library. Then it was removed which was a mistake I think. PartSize helps but it's not enough. Not pooling buffers still causes unnecessary load on the GC.

We cannot we did the pooling it was worse. S3 API unfortunately makes it very hard for us to achieve an efficient streaming-based approach.

@sdhoward
Copy link
Author

The comment in the code should be updated so that the doc warns the user about this default behavior. I'm really not asking for anything more complicated than that.

@harshavardhana
Copy link
Member

The comment in the code should be updated so that the doc warns the user about this default behavior. I'm really not asking for anything more complicated than that.

Feel free to send a PR to update the doc @sdhoward

kamikazechaser added a commit to kamikazechaser/minio-go that referenced this issue Jan 23, 2022
* PutObject with the -1 fileSize param allocates approx ~500 MB.
* This warning should be clear in the docs and not only in the inline docs
* ref: minio#1478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants