You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
goroutine 676455 [select, 221 minutes]:
net/http.(*persistConn).writeLoop(0xc006a00000)
/snap/go/10828/src/net/http/transport.go:2458 +0xf0
created by net/http.(*Transport).dialConn in goroutine 676453
/snap/go/10828/src/net/http/transport.go:1800 +0x1585
goroutine 660868 [select, 239 minutes]:
net/http.(*persistConn).readLoop(0xc00691eb40)
/snap/go/10828/src/net/http/transport.go:2261 +0xd3a
created by net/http.(*Transport).dialConn in goroutine 660761
/snap/go/10828/src/net/http/transport.go:1799 +0x152f
...
It took me a while to confirm that it was the problem here. One reaquest would lead to two leaks.
I just briefly looked at the source code and found that there can be some readings of Body in transport.Perform(req) . Although I don't have time to find the specific cause of this leak, manually Close the Body can prevent the leak.
go 1.22
go-elasticsearch/v8 v8.16.0
According to the doc says:
I wrote my code like
Then the memory usage began to grow.
And I got this
and
and a lot of
It took me a while to confirm that it was the problem here.
One reaquest would lead to two leaks.
I just briefly looked at the source code and found that there can be some readings of
Body
intransport.Perform(req)
. Although I don't have time to find the specific cause of this leak, manually Close theBody
can prevent the leak.By the way, I'm not sure if other APIs have the same problem.
The text was updated successfully, but these errors were encountered: