Increasing memory usage when only using spin_once
See original GitHub issueIf the timeout in spin_once is set to zero (see snippet below) the program will continuously allocate new memory. If any other value or the default infinite timeout is chosen, everything works fine.
rclpy.init(args)
node = rclpy.create_node('test_node')
while rclpy.ok():
rclpy.spin_once(node, 0)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:32 (21 by maintainers)
Top Results From Across the Web
How To Fix High RAM/Memory Usage on Windows 10 ...
How To Fix High Disk Usage on Windows 10:https://www.youtube.com/watch?v=VRf-6E4LL2Y&feature=youtu.beHow to Fix High CPU Usage on Windows ...
Read more >Extremely high memory usage while doing next to nothing
Recently (past two weeks) I've been having extremely high RAM usage with only MS Edge open. Task manager says that MS Edge is...
Read more >Troubleshoot high memory use in an ElastiCache cluster
I'm seeing high or increasing memory usage in my Amazon ElastiCache cluster. How is memory usage determined on ElastiCache cluster nodes?
Read more >Fix High RAM Memory Usage Issue on Windows 11/10 [10 ...
Therefore, when your computer is with high memory usage issue, you can try the following steps to increase virtual memory: Step 1. Right-click ......
Read more >Windows 10 High Memory Usage [Causes and Solutions]
The memory is used to temporarily store the operational data of CPU and the data exchanged with an external memory (such as a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With all the referenced PRs merged I can run the infinite
spin_once
loop as well as the large publisher (and a corresponding subscriber) with constant memory usage. 🎉@ArkturusMengsk @IanTheEngineer @srsidd @BrannonKing please give the current state a try and report back how your experience is. I will close this ticket for now but if there are still reproducible examples left which need fixing it can be reopened. Thanks.
No, I didn’t rebuild Python and all of that (which that document suggests). I fired up the test program from the first comment, and after about 30 seconds of running, I’m now up to 3g resident memory (confirmed using
top
). I killed it at that point; something is clearly leaking a lot of memory pretty quickly. If I run the same program, but leave timeout_sec as None (the default), no memory is leaked at all.