Skip to content
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

CPU load increases over time to 100% #40

Closed
iaamp opened this issue Nov 21, 2022 · 2 comments
Closed

CPU load increases over time to 100% #40

iaamp opened this issue Nov 21, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@iaamp
Copy link

iaamp commented Nov 21, 2022

The issue:
CPU load of the Python process increases over time until it reaches 100%. This in turn slows down everything in the Python process, and if using threads, these can get starved due to _thread.lock times of a couple seconds.

How to reproduce:
pair Parrot Anafi with SkyController
connect SkyController to computer via USB
use an example file, i used olympe/doc/example/listener.py
modify the file in following way:

import time
...
# using Parrot Anafi with SkyController
DRONE_IP = "192.168.53.1"
...
# remove all listeners
# remove all asserts and calls that would move the drone
...
drone.connect()
while True:
    time.sleep(1)
...

Observation:
Over time, CPU load increases until it reaches 100% (of one core/thread, not whole system). Once there, obviously load cannot further increase, due to Pythons GIL. It starts out at my machine (Intel NUC i7 with Ubuntu 20.04) at about 15-20% CPU usage (of one core/thread, not total system). The total time until 100% is reached seems to depend on the number of additional calls, e.g. listeners. On my machine, it takes up to 10 minutes in this example, and about 3-4 minutes with my my application that uses Olympe SDK.

Expectation:
Python processes using Olympe SDK run stable at constant CPU load forever. From my perspective, there is no reason why anything should accumulate in in the drone object that would lead to this behavior.

Already tested
Removing the call to drone.connect() fixes the issue
Removing the listeners seemed to slow down the accumulation of CPU load, but i didn't profile it

System Info
Intel NUC i7
Ubuntu 20.04
Linux 5.13.0-rt1 (Note: observed same behaviour before on non-RT kernel)
Python 3.8.10
virtualenv 20.16.7
Olympe 7.4.2 running in an virtualenv (Note: i observed the bug before in 7.2.x, but back then thought it was an issue with my own code)

@ndessart ndessart added the bug Something isn't working label Nov 30, 2022
@ndessart
Copy link
Member

This should be fixed in the 7.5.0-rc1 release.

@ndessart
Copy link
Member

This should now be fixed in the 7.5.0 final release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants