-
Notifications
You must be signed in to change notification settings - Fork 260
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
👨🌾 rosbag2_transport can run out of memory in coverage jobs #872
Comments
This is still happening with Humble and Rolling sometimes: https://ci.ros2.org/job/nightly_linux_coverage/1606/ I think Shane's suggestion here is probably the best one; we don't need to recompile the tests multiple times for different RMW implementations, we just need to set the RMW_IMPLEMENTATION environment variable when running. For that matter, we could decide not to bother testing multiple RMW implementations in here, as the purpose of these unit tests is to test out rosbag2 and not the RMWs. That said, I'm less in favor of that since having multiple RMWs here at least gives us some additional coverage on all RMWs. |
@clalancette From one hand you are right unit tests for rosbag2 should test rosbag2 and not RMW implementations. Also very often issues related to the RMW implementation not reproduces or very difficult to reproduce on local machine. And they are more likely to be reproduced on CI. One of the real examples of such failing test is I wouldn't recommend to going away from running rosbag2 tests on all RMW implementations. I would propose to try reduce memory footprint during compilation by trying to address some findings and suggestions from include-what-you-use report. |
Hi, I am experiencing this issue while building My system is:
I am wondering if there are any workarounds or recommendations to successfully build packages that require a lot of RAM (>3GB) on limited platforms like raspberry-pi or the pinebook pro? Any suggestions will be very appreciated! |
So what you are running into is almost certainly different that this issue. This issue is specifically about building with coverage enabled. That said, on resource-constrained platforms, you can usually get around RAM problems by building with something like the following:
Which will cause all packages to be built one-by-one, while also only building a single file at a time. As you can imagine, this makes building very slow, but will use the minimum amount of RAM. If you still can't build after this, then the platform just doesn't have enough memory. We would love to reduce the compilation memory usage, so if you find a way to reduce it, please do feel free to open PRs that we will be happy to review. |
This has been a "known issue" for a while, we'll track it using this ticket. This was closed some time ago: #1015 reporting the same problem. |
Description
** Clear and concise description of the feature that you'd like to exist, from a user's perspective. Don't get into implementation details, describe what you want it to do. Put any consideration of alternate features that might solve your problem as well. **
The package `rosbag2_transport appears to have run out of memory while building in the Rolling coverage nightly.
https://ci.ros2.org/job/nightly_linux_coverage/1371/ . Building locally, I notice the package required ~15GB peak to build on my desktop, but the peak number probably varies with the number of CPU cores used.
Related Issues
Completion Criteria
Implementation Notes / Suggestions
I looked briefly at
rosbag2_transport
withinclude-what-you-use
to see if there are excessive includes that could be increasing the memory required to compile. Nothing really sticks out to me exceptrclcpp/rclcpp.hpp
can be replaced with one or two more specific headers in a lot of cases. I didn't try it to see what the impact to memory usage is. I attached the output from the tool in case anyone wants to try its suggestions. iwyu.txtOne thing that does standout is a lot of files get compiled multiple times when they don't need to be.
rosbag2_transport_add_gmock
callsament_add_gmock
with differentRMW_IMPLEMENTATION
environment variables set, but the code shouldn't need to be rebuilt because of that. A way of splitting building the exectuable from configuring the runtime properties of the tests would likely save a bunch of compilation time.Testing Notes / Suggestions
The text was updated successfully, but these errors were encountered: