You are not logged in.

#1 2020-09-06 20:57:14

solonovamax
Member
Registered: 2020-05-04
Posts: 49

ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

TL;DR: The plasmashell process is using an absurdly high amount of ram.
Currently, it's @ 4.0GiB of swap and 1.4GiB of ram.

Recently, I've been noticing much higher ram and swap usage on my computer. After looking into it a bit, it's one of two things. It's either my 300 chrome tabs (no, I mean that quite literally) or plasma.

If I were to do check how much ram plasmashell is using, I see it's using up 1.4GiB of ram. That alone is absurdly high.
Next, using a few commands to list the top 10 processes using the most swap, I noticed that it's using 4.0GiB of swap. That's fucking atrocious and there's very clearly a memory leak somewhere here. Plasma shouldn't be above 600MiB, and yet it's using up a total of FIVE POINT FOUR GIGABYTES OF RAM.

Anyways, if there's any information I need to provide, feel free to ask. (I know there isn't too much detail in this post; I just literally have no clue what information would be relevant.)
Also, if anyone wants, here are the commands I used to list top processes using swap and top processes using ram.

Thanks for your time,
solonovamax


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#2 2020-09-06 21:03:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

300MB here. which widgets/plasmoids are you using? Historically the network/cpu/io bandwith monitors were prone to leaks, they have been rewritten however and I haven't heard any reports in that direction yet. FWIW there might be a relation to the 300 chrome tabs if you have the plasma-integration extension installed.

Also which graphics chip/driver? Integrated graphics might lead to some more RAM being used, though I don't think anything here would directly show up as process memory

Last edited by V1del (2020-09-07 00:19:45)

Offline

#3 2020-09-06 23:04:53

zpg443
Member
Registered: 2016-12-03
Posts: 271

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

Plasma has been solid and plasmashell typically uses less than 1.5% of my 16GB of RAM. Methinks you have a different issue, but then without more I can only guess,

Offline

#4 2020-09-07 18:04:59

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

V1del wrote:

300MB here. which widgets/plasmoids are you using? Historically the network/cpu/io bandwith monitors were prone to leaks, they have been rewritten however and I haven't heard any reports in that direction yet.

Here's is a list of all the widget I have installed:

ls ~/.local/share/plasma/plasmoids/
kpluginindex.json  menuZ  org.communia.apptitle  org.kde.netspeedWidget  org.kde.plasma.eventcalendar  org.kde.plasma.splitdigitalclock

I'm pretty sure the only one I'm using is the netspeed one though.

FWIW there might be a relation to the 300 chrome tabs if you have the plasma-integration extension installed.

That part was a joke; I've closed the chrome tabs and yet the ram usage for plasmashell is still very high. (I don't have an integration for chromium either.)

Also which graphics chip/driver? Integrated graphics might lead to some more RAM being used, though I don't think anything here would directly show up as process memory

I'm using the proprietary nvidia drivers.


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#5 2020-09-07 19:41:33

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

Optimus system?
Obviously try w/o the netspeed plasmoid.

Online

#6 2020-09-07 21:20:31

zpg443
Member
Registered: 2016-12-03
Posts: 271

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

Are you using a non-standard theme or style?

Offline

#7 2020-09-08 18:41:41

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

Optimus system?

Not sure what you mean by this.

Obviously try w/o the netspeed plasmoid.

I uninstalled it and it turns out I wasn't even using it. Haven't rebooted since uninstalling it, but no difference in ram.
Edit: I also uninstalled the event calendar one since apparently it spams a bunch of junk in the logs and I wasn't using it anyways.

Are you using a non-standard theme or style?

I'm using the Sweet global theme, We10XOS plasma style, Breeze application style, PlasmaXDark window decorations, Breeze Dark for my colours, and We10X-black for my icon pack. All installed through the settings menu with the "Get New Themes" button. (They're all highly rated, so I doubt it's caused by them; they aren't obscure random themes or anything.)

Last edited by solonovamax (2020-09-08 18:42:31)


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#8 2020-09-08 18:55:20

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

https://wiki.archlinux.org/index.php/NVIDIA_Optimus
This requires data transfer between the units which might or not go through the process RAM for GL data (and leak there)

Change We10XOS plasma style to (probably) breeze (whatever is the current default) to rule it out as cause.

Online

#9 2020-09-08 23:40:08

werkman2
Member
Registered: 2013-12-08
Posts: 14

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

V1del wrote:

300MB here. which widgets/plasmoids are you using? Historically the network/cpu/io bandwith monitors were prone to leaks, they have been rewritten however and I haven't heard any reports in that direction yet. FWIW there might be a relation to the 300 chrome tabs if you have the plasma-integration extension installed.

Also which graphics chip/driver? Integrated graphics might lead to some more RAM being used, though I don't think anything here would directly show up as process memory




how did you get plasma down to 300MB ram usage?
in my plasma install, i get about 500 to 600mb ram in idle, with nothing running, kvantum theme and standard stock widgets running, and a few services like zram ananicy and firefox-sync.
im not too woried, its fast and snappy, and wont break even after updating just today, about 7 months without updating.

Offline

#10 2020-09-09 05:49:27

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

He's talking about the plasma-shell process, not the overall system load (where the biggest offender is going to be your web browser)

Online

#11 2020-09-11 00:41:08

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

https://wiki.archlinux.org/index.php/NVIDIA_Optimus
This requires data transfer between the units which might or not go through the process RAM for GL data (and leak there)

I'm not using nvidia optimus since I only have a single gpu in my system. (desktop, not laptop)

Change We10XOS plasma style to (probably) breeze (whatever is the current default) to rule it out as cause.

I've changed the global theme to Breeze Dark to overwrite everything else, as I'm 99% sure breeze dark comes preinstalled with kde, so it should have no issues there.
(After changing it there was no immediate effect and after waiting a bit, the ram usage for plasmashell is still at 1.1/1.2GiB)


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#12 2020-09-11 06:17:53

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

If it leaks, the memory will not be freed by changing the theme (you'd have to reboot to free the RAM)

If we can't isolate it this way, you'll have to go for https://en.wikipedia.org/wiki/Valgrind (it's oc. in the repos)

Online

#13 2020-09-11 07:45:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

Maybe so we can have a general idea of what you actually have active throw in the output of

qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.dumpCurrentLayoutJS #Needs qt5-tools

Offline

#14 2020-09-11 22:01:30

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

If it leaks, the memory will not be freed by changing the theme (you'd have to reboot to free the RAM)

I've rebooted since then and after half a day of it being up, I have ~1.3GiB used by the plasmashell process.

Maybe so we can have a general idea of what you actually have active throw in the output of

qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.dumpCurrentLayoutJS #Needs qt5-tools

here is a pastebin with the output of that commands. (It was long and I don't want to spam the thread.)


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#15 2020-09-12 08:41:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

If you wrap outputs in [ code ] [ /code ] tags you don't have to worry about posting long outputs here as long as they aren't as long as to have too many characters to post

From what we see here you have multiple of the potentially problematic monitors I was talking about enabled somewhere. In addition to that, shader based wallpapers (... that could just be a left over config node I have a similar one for the worldmap but if they are actually enabled I wouldn't be surprised regarding memory usage).

What happens if you remove those.

Last edited by V1del (2020-09-12 08:42:11)

Offline

#16 2020-09-12 16:42:33

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

If you wrap outputs in [ code ] [ /code ] tags you don't have to worry about posting long outputs here as long as they aren't as long as to have too many characters to post

I thought it was like reddit (and markdown in general), where it'd be the height of the whole thing, but if it was too long then it'd add a horizontal scroll bar (but never a vertical one)

From what we see here you have multiple of the potentially problematic monitors I was talking about enabled somewhere.

I'll delete those right now since I don't use them frequently.

In addition to that, shader based wallpapers (... that could just be a left over config node I have a similar one for the worldmap but if they are actually enabled I wouldn't be surprised regarding memory usage).

I installed those after I noticed the mem leak, so it's probably not what caused it though I've also disabled that.

I'll update if this works or not.


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#17 2020-09-12 20:58:24

zpg443
Member
Registered: 2016-12-03
Posts: 271

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

Seth and V1del, you have the patience of Job.

Offline

#18 2020-09-15 14:58:45

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

I'll update if this works or not.

I've rebooted since then and with an uptime of about 11 hours, my ram is at 1.0GiB. Doesn't seem to be fixed.

I'm going to revert my theme back to what it was before because I liked how it was configured and the current icon for my file manager confuses me.

Seth and V1del, you have the patience of Job.

Yes, I'm very thankful for their patience. I'd like to think I'm rather good with computers (in relation to the average user), but debugging mem leaks in kde isn't exactly my speciality.

Last edited by solonovamax (2020-09-15 15:00:16)


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#19 2020-09-18 08:02:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

solonovamax wrote:

I thought it was like reddit (and markdown in general), where it'd be the height of the whole thing, but if it was too long then it'd add a horizontal scroll bar (but never a vertical one)

That's one of the primary reasons I absolutely loathe doing any kind of support on reddit, it's incredibly clunky to basically have to use external sites for anything that's bigger than a few lines.

Then I'm out of immediate ideas as well and you might have to check with valgrind, FWIW you don't seem to be an isolated case, but it seems to be the resource monitors in the relevant current case as well. : https://bugs.kde.org/show_bug.cgi?id=426539

Offline

#20 2020-09-18 13:01:45

solonovamax
Member
Registered: 2020-05-04
Posts: 49

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

V1del wrote:

That's one of the primary reasons I absolutely loathe doing any kind of support on reddit, it's incredibly clunky to basically have to use external sites for anything that's bigger than a few lines.

I just like it since I feel it's more intuitive. /shrug.

V1del wrote:

Then I'm out of immediate ideas as well and you might have to check with valgrind

I tried looking into Valgrind, but I can't attach it at runtime and instead have to run it through Valgrind at boot, and Valgrind really slows it down.
I also looked at gdb, but I can't really figure that out. I'm way out of my depth here, since my normal debugging process is using the built-in debugger for IntelliJ.

V1del wrote:

FWIW you don't seem to be an isolated case, but it seems to be the resource monitors in the relevant current case as well. : https://bugs.kde.org/show_bug.cgi?id=426539

I'll look into making a bug report and see if they can help.
Also, I do have one remaining widget which I forgot to remove and hoped it wasn't causing an issue, since I use it semi-frequently to quicky check my ram/swap levels. I'll remove it and hopefully, that should fix the issue.


Thanks for your time,
solonovamax

https://github.com/solonovamax

Offline

#21 2020-11-24 09:28:49

domson
Member
From: Vienna
Registered: 2017-03-17
Posts: 2
Website

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

I temporarly solved a similar issue by running the following, which does restart plasmashell and reset all swap memory
I consider it as a workaround of course, plus it is probably unsave on a running session. So save all your data first.

plasmashell --replace & sudo swapoff -a && sudo swapon -a

any news about the bug report?

Offline

#22 2020-11-24 10:08:34

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: ABSURDLY high memory usage in kde plasma. (Probably a mem leak)

swapoff/swapon will push the anon pages from the swap into the RAM, forcing it to drop file caches - if that does anything, something™ opens a lot of files.
What if you don't restart plasmashell and just swapoff/swapon?
Or does restarting plasmashell free the RAM and you only cycle the swap to "clean" it?

Online

Board footer

Powered by FluxBB