I’m on Fedora 42, and something’s up with my memory usage. On fresh boot I use maybe a gigabyte, maybe 2 after starting hyprland, discord, and a browser. But over time my systems ram usage grows and I can’t tell what process is consuming it. Right now I have almost a day and a half of uptime and I’m sitting at 7.44 gb. I tried closing everything, even hyprland, and it’s still almost seven and a half gigabytes. And yes I am aware of filesystem cache, I’m looking at used and available memory in btop. The total memory usage with tree and aggregate on is 1 gb, so there’s about 6.5 gb missing. Looking back at btop the memory usage has come down to 6.78 gb, so it’s more like 5.78 gb missing. Smem reports similar values, the system wide memory usage is wildly over the RSS total. Earlier my computer almost froze and I had to kill android studio to prevent it from freezing
#Per process memory usage is way less than system wide memory usage
65 messages · Page 1 of 1 (latest)
please give the output of free -h
possibly a kernel space leak?
search kworker/ in btop
their stats should all be 0 though due to limitations
they all are
I have since restarted my system, will ping you when the disparity becomes extreme again with a free -h
this is unfortunately an issue that will require some waiting to debug
If none of the userspace process looks suspicious it’s likely a kernel space leak i think
In which I’m not really sure how to debug but
You can try other kernels and see if anything is different
it may just not be a leak and be pure caching, hence why i wish to see free -h
i mean, Arch uses 10GB ram to cache for me at least. but it will allocate it to other processes if memory runs low
Caching shouldn’t take up the actual memory no?
Aka the available section
She mentioned shes looking at “available” memory in btop
And are aware of caches
i have no clue what it usually displays, hence i find free -h more useful as it displays it all
can caching cause you to run out of memory? cuz it definitely shouldn't
I did notice a large amount of kernel dynamic memory being used, so I decided to log it repeatedly with smem as I opened and closed various apps
it grew to 1.8 gb and stayed there
specifically under the noncache column
I'll have to get the free -h after another day of uptime
have you got an OOM (Out Of Memory) error?
my computer nearly froze and when I closed android studio it gave me a dialogue that saithe smth about the system being low on memory
that however increases the odds of it being a leak..
i still want the output of free -h though in case
No it shouldn’t
If it does that would be a kernel bug
this is free -h, then sudo smem -ktw, then sudo smem -kt
I can also do sudo free -h
if necessary
I ran smem as sudo because it seems to be able to see memory usage for processes started by root
I was in a tty at the time
right now I only have vesktop open, and I'm sitting at 5.5 gb of memory usage
btop reports the total of all processes to be 3 gb
Area Used Cache Noncache
firmware/hardware 0 0 0
kernel image 0 0 0
kernel dynamic memory 8.0G 4.4G 3.6G
userspace memory 1.7G 480.7M 1.2G
free memory 5.3G 5.3G 0
----------------------------------------------------------
15.0G 10.2G 4.8G
smem -ktw
it doesn't seem to have a different output with sudo
see, this is exactly why i wanted you to see free -h. you have a couple of sections. usedis just what it says on the tin. how much the system uses total (both user and non user). buff/cache is how much the system uses to cache. now for the confusing part. available and free are two different sections. so there is a distinction. free the currently free memory on the system (just like smem shows). available on the other hand combines used + some of the buff/cache. the system prioritizes optimizations of itself when it can. but if youre running low on memory, the system will stop using the cache, un allocate it and then allocate it where its needed. its literally what i suspected. there is no leaks anywhere. this is often when i check free -h i look at the available section, because thats how much the system is willing to give up. hope this answers your question
in conclusion, i dont see anything out of the ordinary. i mean. look at my free -h:
[jorgen@jorch ~]$ free -h
total used free shared buff/cache available
Mem: 125Gi 40Gi 68Gi 591Mi 18Gi 85Gi
i have 18GB in the cache. so the free section is rather useless. prefer to look at the available secition
if I've closed everything and gone to tty, I should not be using 4 gigabytes
do it and run free -h then. im still certain its used in the cache
^^
I closed everything, even hyprland, and ran these commands into a log file
well either way, i dont see anything wrong. the free -h output makes sense to me
as i said. the kernel can use several GBs of RAM to cache things. but it is willing to stop using that memory and allocate it elsewhere. so though the idling may seem high from caching, it isnt "wasted" space or a memory leak
look at the available memory
10 gb
vs total
14
available doesn't include cache
so what's using that memory
first of all, it does
secondly, a combintation of: drivers, the entire kernel, slab/slub allocators (which itself can be anywhere from 500MB to 2GB), page tables.
so is it normal for those to take up more memory the longer the uptime
try lts kernel and see if this still happens
in short, yes
well, i did forget to mention the nuance that page tables may grow a bit. but up to a limit. thats on me
but in this case, there doesnt seem to be a memory leak
if its up to the level where the system is running out of memory, i feel like that probably mean something is wrong
idk maybe op can post memory usage again when near crashing