System not freeing up memory/Programs continually using up more and more memory

Edit: Visit this comment for an update on it and a better summary of the whole situation.

A week or so ago, I noticed my memory usage was insanely high. Plasma Shell itself was using more than a GiB of memory, and my total memory usage while idle, discounting disk cache, was more than 5.5 GiB. Reinstalling EndeavourOS did not fix this. I thought it was just Plasma Shell, and reported it to the people over at KDE, but they said it might have to do with my distribution. I took a look at memory usage for other programs and lo and behold, it’s not just Plasma Shell continually using more and more memory, but every program as well. Within two days of a system reboot, it is using a total of 5.5 GiB of memory, and quite frankly, it’s super frustrating. If you could help me resolve this, I would be extremely grateful.

Some things I have noticed:

-The text on resource monitoring widgets seem to be broken, and either disappear or have bad wrapping

-Removing resource widgets seems to somewhat stop this resource crawl.

memory graph
top down 2

First off, welcome to the community :beers:

I’ve never used KDE for more than a few hours myself, but on XFCE I’ve seen where certain themes and fonts can make the memory usage go crazy. I would try changing those and rebooting to see if things are more inline then as far as memory usage goes.

I’m using the default fonts and theme for KDE, but I’ll go give it a try.

It didn’t work, unfortunately. All programs are still gradually using more and more memory.

Yeah. If you had the defaults still that pretty much makes sense. We can cross it off the list at least though. I know you said you reinstalled recently, what programs have you installed since then? Stealing a command from here:

Try: grep "\[ALPM\] installed" /var/log/pacman.log and we can get a list of what you installed.

1 Like

I uploaded it as a PDF since it’s a ginormous log, I hope you don’t mind.

alpm.pdf (39.8 KB)

None of that looks crazy to me, but it’s not like one of them is going to say “memory leak” :stuck_out_tongue:

Did you start having the issue immediately after the install, which was on September 4th (I’m guessing)? If it started on a later date, you could check the list for programs that came at that time and start uninstalling them (pacman -R) until the issue is resolved.

I had Arch installed for a month or so now, and I reinstalled a day or two ago. I believe I had the issue for a while but didn’t pay much attention to it until recently.

Based on that log, not much has changed program-wise in the last few days, only 14 things since last Friday. Are there other changes going on with your system? External/internal drives? Moving partitions? Anything like that?

Now that you mention it, I do have some things I’d like to mention. I have two other internal hard drives, one for my windows install and one for games and such. I tried booting some other distributions on a liveusb recently, but they froze my computer and I had to press the restart button on my case.

If you boot into windows is the memory usage normal there?

Just a passing note here - and I wonder how familiar you are with Linux memory usage? I have often been amazed at how much it can ‘hide’ in caches and such over time, but it so far has always had enough when needed. What is the usage split of your memory use?

Since I rebooted a few hours ago, 22% application data, 16% disk cache. Trust me when I say that both application data and disk cache will quickly fill up my physical memory and then overflow to my swap.

Hard to tell, honestly. I just booted it up and after letting some programs start up it was using 5ish GB of memory.

Oh - I wasn’t aware from the earlier descriptions that it was hitting swap too! I’m out - no knowledge on KDE…

My Memory usage looks like this

97% RAM is used but still 38% is available .

If your system is not slowing down I don’t think this is a problem .

1 Like

“Unused RAM is bad RAM”

Well, it’s not quite true, but it’s the way the Linux virtual memory subsystem works.
There are tons of tweakables to control the behaviour of it, of which two come to mind:
vm.vfs_cache_pressure and vm.extfrag_threshold.

If you absolutely want to drop the caches (which should not be necessary under normal circumstances), issue: su -c 'echo 3 > /proc/sys/vm/drop_caches'

Since nobody posted this one yet:

1 Like

Not only memory. A wrongly coded theme for Xfce can lock the CPU at 100% permanently.

Try cat /proc/sys/vm/swappiness. If it’s 60 set it to 10 with whatever text editor you use.