-
Notifications
You must be signed in to change notification settings - Fork 237
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. #828
Fix memory leak. #828
Conversation
Signed-off-by: Lei Liu <[email protected]>
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 under #822's context.
Although, I wonder if there was a case to capture this concern through a unit test as well? I'm not sure, but this seems like something you would want to test for (i.e. is the client/server correctly "taking" the response/request).
In my option, it's a memory leak bug which may affect many test cases. It's nessary to write test cases for memory leak, but it's may be a big topic. |
For reviewers, just reproducing the memory usage charts from #822 (comment) The same observations should hold for services using |
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.
nitpick.
rclpy/src/rclpy/client.cpp
Outdated
@@ -138,7 +138,6 @@ Client::take_response(py::object pyresponse_type) | |||
|
|||
result_tuple[1] = convert_to_py(taken_response.get(), pyresponse_type); | |||
// result_tuple now owns the message |
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.
There is no reason to keep this comment, I suggest deleting it.
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 with @iuhilnehc-ynos 's comment.
@aprotyas it seems that memory usage doe not change on the graph chart between before and after? it still increases the memory usage constantly on client side? just checking. |
No no, the first image is from before, and the second image is from after this PR. |
@aprotyas Ah, i see it. thanks! |
Signed-off-by: Lei Liu <[email protected]>
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.
Re-CI (error happened on Window because of rti package installation, rebuild with @fujitatomoya setting on ci_launcher):
Should this be backported? |
@Mergifyio backport galactic |
* Fix memory leak. Signed-off-by: Lei Liu <[email protected]> Co-authored-by: Chen Lihui <[email protected]> Co-authored-by: Abrar Rahman Protyasha <[email protected]> (cherry picked from commit ac13665)
✅ Backports have been created
|
Signed-off-by: Lei Liu [email protected]