-
Notifications
You must be signed in to change notification settings - Fork 44
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 issues with reconnect #25
Comments
Here is the valgrind report. stacktraces have been shortened to the relevant part.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran valgrind on my application and several issues popped up involving Beanstalk::Client::reconnect(). I will put the report in a separate post in this issue.
I'm not entirely sure how to fix this, but I did notice the following when looking at the code.
When looking at the code, I notice that strings are passed by value. eg:
In addition, in reconnect(), connect is called with the member values of host, port and float secs already stored in the instance, which values are then again used to set the exact members passed.
This looks like a roundabout way of reconnecting and might be improved by using const string referemces. Since these methods are exactly where the memory issues occur as reported by valgrind, cleaning up might go some way to solve them.
The text was updated successfully, but these errors were encountered: