-
Notifications
You must be signed in to change notification settings - Fork 7
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
Memory issues on large uploads #2
Comments
Yep, this is because of ReadAll call, should be fixed with this commit aa4681e |
I don't use docker, but I will build right away with xcaddy and make some tests. |
Please test the new version |
Well it looks like deep in side the go modules are some more copy parts https://cs.opensource.google/go/go/+/refs/tags/go1.18.2:src/net/http/request.go;l=1299;bpv=0;bpt=1
This parts have no limits as far as I see.
With this statement you mean that only when the upload starts is that high amount of memory used and after some time not more? |
I mean when the upload is started memory usage slowly and steadily goes all the way up to 5-6GB, retains this level for a time and then suddenly drops to 200-300MB which sustains for the rest of the upload. |
I found something interesting - |
Well observation, thank you for your detailed information and that you use the module 😄 Please tell me when we can close this issue with a proper outcome. |
As far as I am concerned it can be closed now. |
@etherwvlf I have created https://github.com/git001/golang-multiparttest to verify the upload behavior. looks like the Memory usage is quite normal. |
This issue could be solved with this commit golang/go#58363 |
I am experiencing strange issues where memory load becomes monstrous when uploading large files.
It starts normal and slowly but steadily process memory grows to explicit amounts.
This for example is the result when uploading 10GB file, around 80-90% of upload completion:

Sometimes memory load hovers around 8-10GB sometimes it goes all the way up to:

I am using this config for testing, but I don't think it is related to an error in the config, as everything works fine and dandy for small files.
As long as you use something big and upload it continuously for enough time this can be reproduced, as I have tried with different size and types of files. Doesn't matter if I use my JS upload form or simply POST-ing with curl the result is the same.
After completing upload, the process retains this memory loaded state for some time and returns to around 400-900MB memory usage after a while which also seems rather much to me for an idle process.
The text was updated successfully, but these errors were encountered: