-
Notifications
You must be signed in to change notification settings - Fork 409
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
issue-919 Fixed "memory leak" in action clients #920
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whenever a call is made to `rclcpp_action::Client::wait_for_action_server` a weak pointer to an Event object gets added to the graph_event_ vector of the NodeGraph interface. This vector will be cleared on a node graph change event, but if no such event occurs the weak pointer will be stuck in the vector. Furthermore, if client code issues repeated calls to `wait_for_action_server` the vector will keep growing. The fix moves the Event object creation right after the early return from `wait_for_action_server` so that the Event object is not created in the case that the server is known to be present and therefore there is no need to wait for a node graph change event to occur. Signed-off-by: Adrian Stere <astere@clearpath.ai>
astere-cpr
force-pushed
the
issue-919
branch
from
November 13, 2019 20:17
23bf8ee
to
fc912d8
Compare
ivanpauno
approved these changes
Nov 18, 2019
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.
LGTM!
@jacobperron for a second check
Fixes #919 |
jacobperron
approved these changes
Nov 18, 2019
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.
Change looks okay to me. Thanks for the fix!
mjcarroll
approved these changes
Nov 19, 2019
Ok, going in. Thanks @astere-cpr for the PR! |
ivanpauno
pushed a commit
that referenced
this pull request
Dec 5, 2019
Whenever a call is made to `rclcpp_action::Client::wait_for_action_server` a weak pointer to an Event object gets added to the graph_event_ vector of the NodeGraph interface. This vector will be cleared on a node graph change event, but if no such event occurs the weak pointer will be stuck in the vector. Furthermore, if client code issues repeated calls to `wait_for_action_server` the vector will keep growing. The fix moves the Event object creation right after the early return from `wait_for_action_server` so that the Event object is not created in the case that the server is known to be present and therefore there is no need to wait for a node graph change event to occur. Signed-off-by: Adrian Stere <astere@clearpath.ai>
ivanpauno
pushed a commit
that referenced
this pull request
Dec 5, 2019
Whenever a call is made to `rclcpp_action::Client::wait_for_action_server` a weak pointer to an Event object gets added to the graph_event_ vector of the NodeGraph interface. This vector will be cleared on a node graph change event, but if no such event occurs the weak pointer will be stuck in the vector. Furthermore, if client code issues repeated calls to `wait_for_action_server` the vector will keep growing. The fix moves the Event object creation right after the early return from `wait_for_action_server` so that the Event object is not created in the case that the server is known to be present and therefore there is no need to wait for a node graph change event to occur. Signed-off-by: Adrian Stere <astere@clearpath.ai> Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
sloretz
pushed a commit
that referenced
this pull request
Dec 5, 2019
Whenever a call is made to `rclcpp_action::Client::wait_for_action_server` a weak pointer to an Event object gets added to the graph_event_ vector of the NodeGraph interface. This vector will be cleared on a node graph change event, but if no such event occurs the weak pointer will be stuck in the vector. Furthermore, if client code issues repeated calls to `wait_for_action_server` the vector will keep growing. The fix moves the Event object creation right after the early return from `wait_for_action_server` so that the Event object is not created in the case that the server is known to be present and therefore there is no need to wait for a node graph change event to occur. Signed-off-by: Adrian Stere <astere@clearpath.ai> Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
DensoADAS
pushed a commit
to DensoADAS/rclcpp
that referenced
this pull request
Aug 5, 2022
* Add C++ bag rewriter Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Whenever a call is made to
rclcpp_action::Client::wait_for_action_server
a weak pointer to an Event object gets added to the graph_event_ vector
of the NodeGraph interface. This vector will be cleared on a node graph
change event, but if no such event occurs the weak pointer will be stuck
in the vector. Furthermore, if client code issues repeated calls to
wait_for_action_server
the vector will keep growing.The fix moves the Event object creation right after the early return from
wait_for_action_server
so that the Event object is not created in thecase that the server is known to be present and therefore there is no
need to wait for a node graph change event to occur.