question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increasing memory usage when only using spin_once

See original GitHub issue

If 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:32 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
dirk-thomascommented, Sep 7, 2017

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.

1reaction
clalancettecommented, Aug 4, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found