Closed
Description
I believe there's some kind of memory leak when using the following Client. b []byte
below is typically 16KB at a time, and is never GC'd after having entered this section of code. Memory use climbs proportional to the number of requests sent on the client. I've ruled out the calling code. It didn't occur before I switched to h2 from HTTP/1.1. I assume some kind of h2 session-related item isn't being cleaned-up due to my unusual configuration.
Client: &http.Client{
Transport: &http2.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
NextProtos: []string{"h2"},
},
},
},
...
req, err := http.NewRequest("PATCH", me.url, bytes.NewReader(b))
if err != nil {
return
}
req.Header.Set("Content-Range", fmt.Sprintf("bytes=%d-", me.off))
req.ContentLength = int64(len(b))
resp, err := me.fs.Client.Do(req)
if err != nil {
return
}
resp.Body.Close()