x/net/http2: increased memory use with ForceAttemptHTTP2 #64164
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
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?
In my golang application we were using the http Client with custom TLS config, and as per the golang's x/net/http package if we provide a custom TLS Config then the support for http/2 will be disabled. So for enabling the http/2 support with custom TLS config I enabled the flag
ForceAttemptHTTP2
flag, but with that I'm seeing a 200MB of memory spike in my application.I'm running this application on a 800 Hosts setup. But as of now none of the Hosts has a http/2 support enabled still I'm seeing this memory spike.
On profiling my application I'm seeing the top contributor for my memory is bytes.growSlice which increased from 8% to whooping 30%. Profile details are as below:
What did you expect to see?
Since I enabled the http/2 support, after the protocol negotiation since I didn't had any hosts supporting http/2 the request should fallback to http/1.1 and application should behave normally.
What did you see instead?
Though requests were falling back to http/1.1 but there was 250MB more memory usage by the application.
The text was updated successfully, but these errors were encountered: