Super high (non-cached) memory usage, please help!

Issue

My system’s non-cached memory usage is too high. It doesn’t make any sense even after summing up all the applications memory usages.

I feel the suspect is AMD GPU GTT super high memory usage.
(I also have full disk encryption)
(32GB total system RAM)

EDIT:
Sometimes the the screen freezes for a few seconds when I’m doing something intensive.
Eg: Frequent screen freezes (for a couple of sec) when I’m screen recording using OBS.
Eg2: When the automatic crash reporting tool runs in KDE plasma, high memory usage by that tool resulted in crashes, a lot of times.

Photos

Radeon TOP + free + smem:

System info:

Operating System: Fedora Linux 42
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.9-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 8840HS w/ Radeon 780M Graphics
Memory: 27.0 GiB of RAM - (2 x 16GB RAM Sticks)
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 21ME001LUS
System Version: ThinkPad P14s Gen 5 AMD

Please lmk if you need more info.

The linux kernel will use all of available memory for caching of stuff like file system data.

You can see this more clearly with the ouput of top.

This is from one of my systems:

top - 20:23:10 up 2 days,  9:39,  5 users,  load average: 0.00, 0.02, 0.00
Tasks: 304 total,   1 running, 303 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.3 sy,  0.0 ni, 99.2 id,  0.0 wa,  0.1 hi,  0.1 si,  0.0 st
GiB Mem :     15.5 total,      0.7 free,      1.7 used,     13.5 buff/cache
GiB Swap:     15.8 total,     15.8 free,      0.0 used.     13.8 avail Mem

Notice that there is only 0,7 GiB of free and 13.5 Gib of cached data.

Just curious - is there any particular issue related to high memory utilization ? If not, why worry ? ((C) Dire Straits)
These days OS tends to utilize abundance of RAM for cashing making your system more responsive and fast. It is good that resources we obtain for our hard earned money are utilized. Would use of, say, 4GB of 28 GB of your RAM make you happier ?

Thanks for the reply. But in my case, kernel dynamic memory usage is too high, that too Non-cached. I strongly believe that this is abnormal.

I fixed my original post to emphasize the non-cached part of the problem.

Thanks for the reply. Yes, there are issues - The screen freezes for couple of seconds when I’m doing something intensive. I’ve included this now in my original post.

But not in my case, since most of the memory usage is from Non-cache memory.
Which I have now (edited and) emphasized in my OP.

It’s true that generally Linux will use plenty of cached memory. However, from the screenshot in the OP, that doesn’t seem to be the only thing happening here.

I had a look at top on my F42 KDE system and compared it with the KDE System Monitor. The “Used” figure in the system monitor GUI corresponds to the “used” figure in top - the GUI isn’t including what top shows as “buff/cache”.

So if OP sees “21.8 GiB used” in the KDE System Monitor GUI, then top is also going to show something like “21 used”.

Thank you for the reply.

top - 13:11:44 up 9 days, 21:55,  2 users,  load average: 0.43, 0.43, 0.46
Tasks: 518 total,   2 running, 515 sleeping,   0 stopped,   1 zombie

%Cpu(s):  1.7 us,  0.7 sy,  0.0 ni, 97.2 id,  0.0 wa,  0.2 hi,  0.1 si,  0.0 st 
MiB Mem :  27692.0 total,   1654.2 free,  22324.1 used,   5666.6 buff/cache     
MiB Swap:   8192.0 total,   2666.9 free,   5525.1 used.   5367.8 avail Mem 

That’s right, I’m seeing significant non-cached memory usage.
I’m not at all worried about the cached part.

Edit: Sorry for lot of edits, I’m figuring out how to include quotes from messages.

This caught me out at first! The [quote] tags have to be on their own line, you can’t inline the text directly before and after them without a line break.

1 Like

It looks like the two web browsers uses a lot of memory, and that is probably related to the number of open tabs.

Running smem -k could shows something interesting.

Thanks for the reply. Floorp and firefox are only occupying around 7GB, which I’m completely ok with.

smem -k is only displaying userspace program’s memory usage - the top usage is by floorp and firefox as expected. Nothing unusual.

Some apps use a lot of RAM (e.g., Floorp), some are buggy and having memory leaks.
E.g., Reddit - The heart of the internet.

Are you 100% sure it is because of memory utilization ? What about I/O ? Network ? CPU or GPU ?

If user space programs like floorp have a memory leak, it would be visible in system monitor and top.
smem -kw output shows something unsual about the kernel space utilization.
12GB non-cached usage in kernel dynamic memory is what I’m worried about.

I’m 100% sure that the CPU, network, and GPU are not the culprit. I’m not sure about I/O though.
But I’m very certain that, during all the crashes and freezes, memory utilization is almost full.

Why are you using Floorp? A quick search says it’s Firefox ESR: Why not use that?

I suspect Floorp as a Firefox ESR fork is probably doing something Firefox doesn’t do to use more RAM (could be mem leak, Floorp deciding to cache everything to RAM for speed, gfx-side bug on old lib causing VRAM use to multiply, etc).


I’d look at private bytes and other memory usage. Bun (Node.js alternate) I’ve seen using 4GB visibly + 21GB private bytes, both way outside of anything normal (regular Node is like 500MB). In that case I just switched the software (back to Node :stuck_out_tongue:).

Thanks for the reply. Here is the memory usage with all the floorp windows killed:

smem -kw

Area                           Used      Cache   Noncache 
firmware/hardware                 0          0          0 
kernel image                      0          0          0 
kernel dynamic memory         14.4G       2.9G      11.4G 
userspace memory               5.4G       1.5G       3.9G 
free memory                    7.3G       7.3G          0 

Please notice that the kernel memory that is non-cached is still abnormally high.
So floorp is clearly not an issue.

1 Like

Try running this:
free -h
and posting the results here. It will give us a good idea how much memory you really have available. And, top has a column listing the %mem used by each process; are any of them higher than you’d expect?

Thanks for your reply. Please check the first image in the original post, there should be free -h output at the bottom.

top’s output is just userspace programs, nothing unusual at all, and doesn’t add up to the total non-cached memory utilization. But the kernel utilization from smem -kw is highly abnormal.

firefox + forks: open new tab in browser about:performance
sort memory tab, what is the amount reported for GPU?

open a second tab about:memory
get a memory report / or measure and save
free memory: minimize memory usage

get another memory report / compare with previous

check again GPU memory usage in about:performance ,
radeontop etc.

Thanks for your reply, there is no GPU column. The memory utilization is as expected and nothing abnormal.

No change in radeontop and smem’s kernel memory. (more or less the same)
There is a (very) minor reduction in user space memory (as expected).

You could try to search for the term “linux kernel dynamic memory details” in your favorite search engine.

The space uses be the zram swap space will show up indirectly as non-cached memory. If you have big files in the /tmp directory, it might also be counted as non-cached.

Once your system starts using a lot of swap space in means you have the preverbial “too many irons in the fire” (look it up).

Just an anecdotal data point, but I also use Floorp as my main browser on a system with 32 GB of RAM (nVidia GPU in my case, not AMD). I’ve never had any memory problems like this. The “Used” number in the KDE System Monitor rarely goes above 16 GB for me.

I usually don’t have a large number of open tabs, but I do use the browser all day long, so it would be surprising if some big memory leak in Floorp was the cause of this.