Skip to content
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

Memory leak in retrier implementation #53

Open
hummerd opened this issue Feb 6, 2025 · 0 comments
Open

Memory leak in retrier implementation #53

hummerd opened this issue Feb 6, 2025 · 0 comments

Comments

@hummerd
Copy link

hummerd commented Feb 6, 2025

We've noticed that in case of use retry policy our services start consume more and more memory that is not freed with time. We have services that makes about 5000 http requests per minute and it makes 9 hours for service to reach memory limit in 60 MB (this is our memory limit in k8s for that service). Without retry policies service not consuming additional memory - it's memory usage stays constant with time.

Golang's pprof shows that objects inuse are not canceled contexts.

I think that the problem is in RoundTrip method. It creates context that in case of successful call will never be canceled and therefore will never be garbage collected. Same goes for RetryAfter implementation. Linter wasn't joking.

Image

@ensary ensary pinned this issue Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant