High memory usage on log burst
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 155
- Forks
- 182
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
Bug report
Required Info:
- Operating System:
- Ubuntu 22.04
- Installation type:
- Binaries (apt)
- Version or commit hash:
- Humble
- DDS implementation:
- FastDDS
Steps to reproduce issue
Launch one or many nodes that logs a lot (using functions such as RCLCPP_INFO and a 1ms timer for instance).
Expected behavior
ros2 launch should be stable regarding regarding memory usage.
Actual behavior
ros2 launch keeps on consuming memory.
Additional information
launch_service queue (asyncio.Queue()) has no limit.
And only one event is handled per loop cycle (this_loop.create_task(self._process_one_event())).
So the queue keeps growing until no memory left.
Note that trying to handle many events in _process_one_event seems to solve the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining launch_service's asyncio.Queue and the create_task call for _process_one_event(), then reproduce the issue with one or more nodes logging from a 1ms timer. Done means ros2 launch remains stable in memory usage during the log burst instead of the queue growing until memory is exhausted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100