net/http: transferWriter.doBodyCopy() calls io.Copy() resulting in many buffer allocations #57202
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have HTTP proxy server proxying plain HTTP 1.1 requests based on google/martian. When I profile the memory allocations I see that
transferWriter.doBodyCopy()
callsio.Copy()
resulting in many buffer allocations. The profile graph is attached below.I think
doBodyCopy()
could usecopyBufPool
we have in response.ReadFrom() to avoid the allocations.The text was updated successfully, but these errors were encountered: