-
-
Notifications
You must be signed in to change notification settings - Fork 20
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 FiniteReplayProvider #22
Comments
Hi and thank you for raising the issue! I've thought of this before and I've made the assumption that when the slice is reallocated the dequeued elements would be dropped – I think I've even left a comment in source code about it. Given that you've flagged this problem, it's most probable I was wrong. I'll analyze your reproduction and do some research – I'll be back with a response in about 2 days. Does this issue raise important problems for your use-case? Just trying to gauge how critical this is for you at the moment. Again, thank you for the issue and for creating the reproduction! It will make things faster and easier. I'll be right back soon with a response and a fix. |
It’s not critical, I noticed the memory leak in a pre-production system, so it’s not really affecting anything at the moment. I wrote a new finite replay provider that uses a circular buffer instead of the base buffer in the package. I could send it your way as a PR. Thank you for your great work in writing and maintaining this package! |
A PR would be very welcome! Thank you for your work. EDIT: PR #23 is now open. |
Sorry for taking so long to merge #23. Released this particular update under v0.9.0-pre.1. |
The slice operations in the FiniteReplayProvider leads to an infinitely growing buffer of messages as the capacity of the buffer will increase on the first append after each dequeue. Reproduced the behaviour as a small code sample:
Output:
https://go.dev/play/p/Ut8T-tyB2-5
The text was updated successfully, but these errors were encountered: