-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems memory leaks with post #753
Labels
Comments
@youzeliang Thanks for reaching out. I'm currently on vacation days; I will be back in January. |
I see that code in resty/v2: func closeq(v interface{}) {
if c, ok := v.(io.Closer); ok {
silently(c.Close())
}
}
func silently(_ ...interface{}) {} See client.go#12000 |
@youzeliang Thanks for reaching out. Based on the above details. Currently the method In the v3, there are plans to optimize the flow. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In most cases, I use the resty library's Post method to send POST requests, and everything works fine with no issues. However, in a particular scenario, when I receive a large response structure, I encounter a memory leak. Firstly, I want to clarify that my code doesn't have any goroutine leaks or lingering global variables (i.e., no delayed releases). Upon using pprof to inspect, it seems that the underlying io.readAll operation is consuming a significant amount of memory. Are there considerations for optimizing this part? I will attach my pprof results and some key information along with the crucial parts of the code.
resty.New(). OnBeforeRequest(func(client *resty.Client, r *resty.Request) error { return nil }). SetRetryCount(2). SetTimeout(time.Second * 8). R(). SetFormData(apiBody). SetResult(&apiRes). Post(url)
the response apiRes is about 4k
The text was updated successfully, but these errors were encountered: