Fuchs / hoppla-sa

Linux / KDE Plasma desktop widget to control Philips Hue lights. Controls lights, groups and customizable actions.
https://store.kde.org/p/1168067/
GNU Lesser General Public License v2.1
65 stars 6 forks source link

Memory leak #9

Closed sjclayton closed 5 years ago

sjclayton commented 5 years ago

Experience a very clearly noticeable memory leak while using this plasmoid on KDE Plasma 5.14.5 / Frameworks 5.54.0 / Qt 5.12.0 running on Arch Linux.

Memory consumption of Plasma Shell just keeps increasing while I have Hoppla (version 2.8.0) running in one of my panels. As soon as I remove it, the memory used stops increasing.

Fuchs commented 5 years ago

Hi, I see if I can reproduce that on my gentoo machine with similar versions. Do you get any useful output if you start plasmashell from a terminal that might lead to the culprit?

Is the memory usage increase also there if you disable / set a very long delay for auto updates? If it does, please try reverting to a 2.6.* version that didn't have the auto-update in background yet, I wonder if there is a regression, however, I was not able to reproduce it with 2.8.0 on my machines yet.

sjclayton commented 5 years ago

I ran plasmashell from the terminal and there was no output at all, regarding anything...

I disabled the auto-update and it appeared to make absolutely no difference.... memory use still continued to go up... I removed the plasmoid and re-added it to the panel, making sure auto-update was unchecked, still same thing happens.

Memory use goes up with my system sitting idle, with only KSysGuard running.... Plasmashell memory consumption increases by 100-500k every 5-15 seconds.... as soon as I remove Hoppla from the panel it stops rising.

Will try reverting to a 2.6.x version and see what goes on...

EDIT: Reverted to 2.6.2 and it seems to not have the issue so far. Will continue to monitor however.

Fuchs commented 5 years ago

Okay, could you check whether you have the issue with 2.8.0 if it doesn't poll in the background, e.g. with this specific part https://github.com/Fuchs/hoppla-sa/commit/6badbb4ed8e4995f0d2093d650e4c84a1967ba1b#diff-ffb48ae16700db9c877062cdb73f8df2 (CompactRepresentation.qml) reverted?

Given I can't reproduce it on my machines I assume it's still a mixture of a bug or changed behaviour in a library (Qt or frameworks), but knowing this might help to find it.

sjclayton commented 5 years ago

I just noticed it started doing it on 2.6.2 as well.... Plasmashell grew from about 90MB res. memory to over 300mb since I last edited my msg, and I've literally just had the machine idling since then.

I will play around with 2.8.0 and reverting to that diff in a little bit and let you know.

Fuchs commented 5 years ago

Please also let me know if that happened since you started using hoppla, or whether you updated other things (frameworks, Qt, ...) since it started happening. I can't reproduce it with any version on any of my machines, and so far users I asked couldn't either.

xf- commented 5 years ago

I also use Arch with KDE - QT 5.13 / Plasma 5.15.4 / Framework 5.57.0 and have no issue. Installed via https://aur.archlinux.org/packages/plasma5-applets-hoppla-sa-git/ First time opening hoppla uses around 100mb RAM, but no noticeable changes afterwords.

Fuchs commented 5 years ago

Closed for now as I was not able to reproduce on any distribution, nor found anyone who could, sorry :/

xf- commented 5 years ago

@Fuchs i think the increase in memory usage is http client and refresh interval setting. if i killall http.so and set interval to 1 second, i see a small increase in RAM useage.

Fuchs commented 5 years ago

http.so is part of KDE, namely kio. That having a memleak would explain why only some users see it, and unfortunately I wouldn't be able to fix that in my plasmoid.

Also according to the initial reporter they disabled auto update completely and it still happened, so a leak in kio should be unrelated.