In my golang application I was using a x/net/http package with a custom TLS Config making http/1.1 connections only. I wanted to introduce the http/2 support to my application. Since I was using a custom TLS Config, which disabled http/2 support by default. So to enabled the http/2 support, I setted the ForceAttemptHTTP2 flag to true in my transport.
Expected Result:
For the server which support http/2 the request should be upgraded and http/2 call should be made. And if not supported the request should fallback to using http/1.1
Though I'm seeing the expected result but there's a 200MB more memory usage by my application. I profiled my application and found that readLoop and reading http2 frames is taking up more memory.
1. Profiling With http/2 enabled

2. Profiling without http/2 enabled:
I also tried the same with providing explicit http2 transport from x/net/http2 package, but was still seeing a higher memory usage.
Any experts with using http/2 with golang please help out with this.
Is this an expected result that with http/2, that we will be using more memory at the cost of multiplexing and streaming? Or am I missing something here?