r/linuxquestions • u/Otherwise_Win_5363 • 12d ago
Support Varying ram usage
Why does ram vary so much between different hardware/people ?
I often see people with builds at ~500mb idle, some are even lower so I wondered how it's possible and what makes that happen ? For example I tried Arch and was at ~700 in the tty, and Gentoo was at ~600 but even if the tty in my opinion uses quite a lot, the more interesting part is apps. For example the sole reasons I'm not using kitty and hyprland is because of their ram usage, both of them were using ~250-350mb of ram each on their own, and I had to replace them with foot which would use ~30mb and sway which would use ~90-110mb, but it came to my surprise when I was watching videos and looking at people's btop ram usage that kitty was using ~50-100mb. Even more so, recently asked a friend of mine to share his, and they have kitty on 127mb, but also hyprland at 55mb ?!?! How, just how ? Why is hyprland using at least 5x more ram for me than it is for them ? I tried disabling animations and everything unnecessary in hyprland but it genuinely made no difference, so I just switched to sway. Matter of fact I even tried more wm's like mango, river, niri, wayfire, and they would each use at least 300-350mb, which is surprising because I thought hyprland was supposed to be the heavy one. I thought it was kernel configuration at first but he's just using stock fedora. Even as of writing this asked someone else and hyprland is using ~50mb and kitty's at ~80mb, so does anyone mind enlightening me as to what is going on and if I can somehow fix this ?
6
u/Excellent-Love-6943 12d ago
When you have more ram, more stuff gets cached.
My 32GB ram desktop idles with over 1-1.5GB used, my 8GB laptop idles at around 800mb. Same setup: Arch with Plasma.
Obviously you have to add variance for background applications, other DEs/WMs, etc.
1
u/mredding 9d ago
This is something you can ask Google AI, and it can walk you through. For the sake of your question, I asked it to help me see what specific programs are using how much physical RAM, and it gave me a command to run:
Alright, what ARE these programs? Of course Firefox is fat, I'm not worried about that right now. I asked the AI what gjs is and why it's so large - it's a Javascript engine GNOME uses.
I asked if I can reduce the memory usage of
gjsand it said no BECAUSE of the underlying libraries and implementation details it depends - this stuff has to take up some amount of space; but what I can do is disable it, or the GNOME extensions that rely on it, and then it gave me a compelling walk-through on how to do some of that.The point isn't to copy/paste what it gives me and cause damage, but to have a conversation about my system with an agent that can respond faster than you're going to get on Reddit. And you get breadcrumbs so you can ask more questions. NOW I'm genuinely curious about what GNOME extensions I'm running but don't use or need...
In the end, you can figure out why your system is the size it is until you basically get down to the philosophical Q&A of what makes one distro different from another? The packages it's made of - what choices and compromises that represents, and how those packages are compiled for size or speed or features...
gjscomes down to two libraries calledSpiderMonkeyandGTK4and their inherent sizes, and if you can code a smaller Javascript engine, you're welcome to do it. Right? These things are about as small as they can go, and different distros are going to have different philosophies and opinions about how to run a distro and what all should be running.I mean, there are still Linux distros that aim to fit on floppies and other extremely small form factors (by today's standards), and more than just that - small memory footprints. But what all must you sacrifice to get there? You ain't getting Ubuntu out of that.
1
u/ipsirc 12d ago
Just don't run unnecessary services.
Ask them which services they are running. You have a mouth and a keyboard.
I'm pretty sure they didn't load any modern gpu driver which costs hundreds of megabytes alone. You can go even lower at the cost of performance.
2
u/EatTomatos 12d ago edited 12d ago
I mean, Debian and Fedora are both known for breaking up libraries into separate packages. This is not how software is usually packaged. Arch linux experimented with it a little at one point, but they went with the sane option of keeping packages contained like they are shipped as.
This means when you install a arch package, you get everything for that package. Now arch doesn't force optional packages, but they are still available.
So perhaps something about Fedora and how they configure systemd and packages is causing aggressive sleeping of non essential services.
1
u/SuAlfons 11d ago
It varies with what services run in the background. What extensions and helper apps you use. And cache will be bigger when you have more RAM.
I don't even know my idle RAM consumption. My system runs well and I use a boatload of extensions on Gnome
1
u/Open-Adhesiveness-86 11d ago
half of this is a measurement artifact. btop shows RSS, which counts every shared page in full and also counts whatever the gpu driver maps into the process, so hyprland on nvidia looks enormous next to the exact same build on intel/amd. compare cat /proc/<pid>/smaps_rollup and read Pss instead, the numbers usually collapse to within noise of your friend's.