-
Notifications
You must be signed in to change notification settings - Fork 653
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
Enable TraceOn will cause OOM #1771
Comments
Even if this is just for debugging purposes, as a widely used public library, maybe we could write a simple function that just prints the meta data of the HTTP request, instead of the whole enchilada? |
We do not read the body at all @mingyang91 Line 451 in 230e538
The issue is because of something else here. what is the size of the file
and how much memory do you have? can you share the profile? |
This is a massive test file created with I found out that the issue stems from |
I came across a similar issue on aws/aws-sdk-go-v2#1618, and @prembhaskal submitted a fix and pull request to the standard library (golang/go#51662). |
With latest |
Re-produce:
If I turn on
TraceOn(...)
, it can consume a lot of memory, resulting in an OOM error, when IPutObject
with a large file. I think this is because when we use theDumpRequestOut
function, it loads the entire request body into memory, even though only the HTTP header is needed. Check out this line of code in the dump.go file on:https://github.com/golang/go/blob/master/src/net/http/httputil/dump.go#L157-L167
Do you think we could use a more stream-based approach instead of the heavy-duty DumpRequestOut to avoid the memory consumption peak?
The text was updated successfully, but these errors were encountered: