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

PutObject and size -1 causes massive memory allocation #1473

Closed
jochenhz opened this issue Apr 3, 2021 · 1 comment
Closed

PutObject and size -1 causes massive memory allocation #1473

jochenhz opened this issue Apr 3, 2021 · 1 comment

Comments

@jochenhz
Copy link

jochenhz commented Apr 3, 2021

Gitea is calling PutObject with PutObjectOptions size -1. When doing so with small objects around 30kbs in size the minio sdk allocates around 700MB data whereas everything works fine when providing the actual size directly.

For gitea I've created a docker compose file that uses gitea and minio + some reproduction steps.
go-gitea/gitea#15253

@harshavardhana
Copy link
Member

You need to control how your parts are going to be uploaded, unfortunately there is no streaming way to upload in S3 API.

Since the chunking is done automatically inside minio-go when -1 is provided you need to make sure to have a top level partSize limit. Otherwise we will calculate the maximum possible part limit per part to upload 5TiB object maximum object size allowed in AWS S3 upto 10,000 parts.

Either provide the right content length or when using -1 use appropriate PartSize in PutObjectOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants