go-resty / resty

Simple HTTP and REST client library for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

memory leak when response is too large

royalraul opened this issue · comments

image using go-resty, where response body is too large, the memory usage is increasing gradually, I find 'if response.body, err = io.ReadAll(body); err != nil' may be the cause. could it be changed using ‘io.copy’ or other way.

You can disable response parsing/reading and use io.Copy manually with the raw response object's body.
Don't forget to close the response object's body.
Issue can be closed.