Bug 339406 - kdeconnect consumes 50 % cpu power
Summary: kdeconnect consumes 50 % cpu power
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: plasmoid (other bugs)
Version First Reported In: 0.7.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-26 06:43 UTC by Philippe ROUBACH
Modified: 2018-01-16 20:31 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe ROUBACH 2014-09-26 06:43:15 UTC
opensuse 13.1 x86_64 , kde 4.14.1
kdeconnect 0.7.2

android 4.2.2
kdeconnect 0.7.2
vlc remote 0.5.8

i use vlc remote with my smartphone to manage vlc in my pc

vlc is launched with its "web" interface (lua http)

during the evening  i am sitting in my armchair viewing several videos during about 3 h
during these 3 h i start and quit several time vlc remote to choose a video .
during viewing a video my smartphone disconnects and reconnects to the wifi lan several times
because smartphone searches constantly the best wifi lan .

result : each evening after a delay i hear pc fan noise increasing indicating something consumes much cpu power
then
i display the list of services
then
i see that kdeconnectd consumes 50 % cpu power

i try to stop kdeconnectd with kde service manager
kde service manager says that kdeconnectd is stopped but it is not . i must kill it
then
with kde service manager i can start it again

where is the pb ?
- conflict with vlc remote ?
- wifi disconnections and reconnections ?






Reproducible: Always
Comment 2 Philippe ROUBACH 2014-10-05 14:01:11 UTC
i reopen the bug report
now i have a better diagnosis

sometime smartphone disconnect to the wifi lan then reconnect.
but sometime smartphone says "connected to <lan>" and it is not very well connected
i can check this with for example csipsimple or vlc remote which does not work
then
in this case
if i launch kdeconnect in smartphone and try to move mouse cursor
then
kdeconnect in pc consumes 50 % cpu power
Comment 3 Philippe ROUBACH 2014-10-10 09:01:51 UTC
another experiment :

this morning after 2 hours using my pc suddenly kdeconnectd consumes 50 % cpu power .
i tried to wait to see what happens .
after  3mn phenomenon does not stop .
i killed kdeconnected .

is there any log to read somewhere for a better diagnosis ?
Comment 4 Philippe ROUBACH 2014-10-10 11:58:26 UTC
it seems now that evrey time i kill then restart kdeconnectd
then
after a short delay some minutes kdeconnected consumes 50 % cpu power

i can't use anymore kdeconnect .
Comment 5 Philippe ROUBACH 2014-10-10 12:27:35 UTC
i can reproduce pb only by moving mouse cursor with smartphone .

hypothesis : pb is around networking
each time smartphone kdeconnect communicates to pc or pc kdeconnect communicates to smartphone then pb occurs .

i use the new plasma-nm 0.9.3.4-2.1 , not kdenetworkmanager which is obsolete with kde 4.14.1
some days ago plama-nm was updated
it seems since this day it is worst . I have this new phenomenon : without doing nothing with kdeconnect suddenly kdeconnectd consumes 50 % cpu power .
Comment 6 Philippe ROUBACH 2014-10-11 10:30:18 UTC
i made this experiment :

i saw that ip address of pc and smartphone changed
then
i restored the old addresses for smartphone and pc
then
no more pb

i assume that kdeconnect does not like dhcp ip address allocating thus does not like ip address changing .
Comment 7 Albert Vaca Cintora 2014-10-11 16:54:14 UTC
It shouldn't be a problem if there is an IP change. Can you reproduce the issue on a different computer? It seems that you are the only person affected by this bug, so maybe it is something related to your system configuration.
Comment 8 Christoph Feck 2014-11-16 16:44:00 UTC
If you can provide the information requested in comment #7, please add it.
Comment 9 Philippe ROUBACH 2014-11-17 09:50:18 UTC
sorry i have not another pc to test
Comment 10 boris64 2014-11-25 20:14:29 UTC
Similar problem here. I just installed kdeconnect on my mobile (razr i)
and paired it with my kde desktop (i'm on gentoo linux, kdeconnect-0.7.3).
-> kdeconnectd takes up to 100% cpu

Unfortunately i don't know how to reproduce / debug this issue.
Any tips? Is there anything i can do to help?
Comment 11 Derek Broughton 2015-03-16 18:02:58 UTC
(In reply to Albert Vaca from comment #7)
> IIt seems that you are the only person
> affected by this bug, so maybe it is something related to your system
> configuration.

He certainly isn't. There's an Ubuntu bug report that sounds identical, though dated well after this (https://bugs.launchpad.net/ubuntu/+source/kdeconnect/+bug/1396367), and I see on your blog that somebody else mentioned emailing you (again, after this).

It happened to me for the first time, today, on a Debian Sid system running 0.8-0ppa3+pkg7~ubuntu14.04.1

I note that after killing kdeconnectd and restarting it, kdeconnect shows no devices connected and the Android app on my device tells me "Paired device not reachable".
Comment 12 Derek Broughton 2015-03-16 18:06:14 UTC
I see also that if I try to use "add devices by IP" in the android app, I _still_ have no connections.
Comment 13 Ashish Bansal 2015-03-19 10:02:59 UTC
Well I have not observed this problem in released version but while debugging on some other bug, I have observed something which might be a possible reason.

If there is newUdpConnection and udpServer hasPendingDatagrams but we are not reading them, then CPU usage increases drastically. You can try it by adding a return statement

Generally this condition would not prevail but it may exist onNetworkChange or something related to that as we don't know upstream code that how QUdpSocket behave on network state change. So, I think it would be better if we destroy them and recreate them onNetworkChange or even better restart whole daemon.
Comment 14 blume_bunte 2015-10-25 12:49:18 UTC
I have a similar Problem. Since two days every time I start my computer KDEconnect needs one CPU core on it's own. When I kill the task it's over, but I can't use KDEconnect anymore. Before I kill the task, I can use KDEconnect properly. When I restart KDEconnectd everything is fine until I do something e.g. open the KDEconnect App on my mobile.
Comment 15 Martin Oemus 2015-11-03 23:50:49 UTC
I experience similar problems. I am working on:
Kernel 3.13.0-66-generic x86_64
Ubuntu 14.04.3 LTS
kdeconnect 0.8-0ppa3+pkg7~u amd64

I can not really tell when the problems started, probably a few days ago, two to three weeks at the most.

kdeconnectd seems to consume 100% of one core as soon as it establishes a connection to a paired device. kdeconnect itself is still perfectly usable, all plugins work as usual. The heavy cpu load is the only problem.
I am aware that with this little information you can probably not really do anything. I have developed with QT in the past, though not with KDE, but maybe you can point in some direction as how to debug the whole thing a bit in order to supply you with more information?

Best regards
Martin
Comment 16 flyos 2015-11-05 13:17:18 UTC
I have the exact same behaviour as depicted in comment #11.

 The bug is always reproducible when I start my computer with the phone connected by Wifi. Otherwise, I need to use the phone to trigger the bug on my computer.

My system:
- Kubuntu 14.04
- KDE 4.14.2
- KDEconnect 0.8-0ppa3+pkg7~ubuntu14.04.1 from the http://ppa.launchpad.net/vikoadi/ppa/ubuntu/ PPA
Comment 17 Aleix Pol 2015-11-12 01:54:02 UTC

*** This bug has been marked as a duplicate of bug 345102 ***
Comment 18 Albert Vaca Cintora 2015-11-12 15:01:07 UTC
Not a duplicate, one is about the app, the other about the desktop.
Comment 19 Dotan Cohen 2015-12-01 11:11:40 UTC
In addition to CPU, sometimes kdeconnectd will use upwards of 300 MiB of RSS:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
dotanco+  1787  1.0 11.6 1055976 342448 ?      Sl   Nov19 172:14 /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
Comment 20 Philippe ROUBACH 2016-12-23 15:32:47 UTC
for me since many tyme no more problem with opensuse 13.1 and kdeconnect-kde 0.9g and opensuse 42.2 kdeconnect-kde5 1.0.1
Comment 21 Aleix Pol 2018-01-16 20:31:24 UTC
Doesn't seem to happen anymore.