-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix memory leak in connmanager #1576
Conversation
@hxw Sorry I missed this one. Looks good. Is there any chance you could rebase this so the CI can run properly and squash to one commit? I think that is all it will need to be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase and squash but otherwise looks good.
Sorry I totally forgot about this, until I rebuild my program last week and I stated getting leaks over the last few days, only just realised what the problem was. I have merged my branch with the current master and will test first. I will then rebase, squash etc. when I have done some testing. |
fix memory leak in connmanager caused by: * pending entries are not removed on error * new connection always allocates new struct * capture id value for callback Fix by calling Remove in both handleFailedConn callbacks to delete the item from the pending hash map Signed-off-by: Christopher Hall <hsw@bitmark.com>
Pull Request Test Coverage Report for Build 3889135262
💛 - Coveralls |
Pull Request Test Coverage Report for Build 3889598567
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now!
OK
In the case of an error the connection struct is never deleted from the pending hash map.
In some testing I observed leaks of 3MB in an hour
The problem stem from the fact that the handleFailedConn does not reuse the connect but allocate a new one