this post was submitted on 09 Nov 2026
45 points (89.5% liked)

Linux

19907 readers
219 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 3 years ago
MODERATORS
 

This is bullshit. I wanted to play Terraria last night but I looked at my RAM usage and it was sitting uncomfortably high at 13 GB (of my 15). So, I close Terraria, and it drops about 2 GB. I close Firefox, Thunderbird, and Zed, and that drops about 2.5 GB. Then I close basically everything and it's still super high! Each time this happens, I have to restart my computer in order to get the RAM usage lower.

Whenever I look this up it's usually two camps:

  • KDE is just bloated.
  • Unused RAM is wasted RAM.

To address both of these:

I disabled a few things in KDE like file indexing (which was my home directory). Cool, so that saved like 100 MB. KDE is supposed to idle at around 3GB anyways, so what now?

The "unused RAM" belief is like a folktale at this point. It's not true anymore, and buffered/cache memory is shown separately. Plus, I can drop those caches whenever I want... Which I did. File inode cache only really became a problem for me when I was doing Minecraft Datapack development and I was creating hundreds of files on a regular basis as part of hot reload. Then I'd have to drop the entire cache because it wasn't being free'd...

However, the RAM I'm complaining about is actually not that, because it steps on my available RAM meter. Having a game freeze up because I was out of memory is a pain in the ass.

I even tried installing Zram, which only made matters worse since the active memory allocations seemed to be robbing the CPU of time it would be running game code, just so it could compress file pages. (My system has also just had major lag problems with swap, in general, during high memory pressure, which I should probably report as a bug). My swappiness was probably way too high, but regardless I didn't see major improvements from that and it only seemed like a bandaid to the real problem. Also, why should I need to use swap when I have 16 GB of RAM and only a few programs open at a time?

This whole thing is pretty annoying. Whenever I have like 11 hours of uptime my memory is unusually high. I also can't seem to track it down to any particular application...

System: OpenSUSE Tumbleweed

all 41 comments
sorted by: hot top controversial new old
[–] WereCat@lemmy.world 3 points 5 hours ago* (last edited 5 hours ago)

If unused RAM is wasted RAM then:

1.) Windows must be using more RAM to be slower a lot faster

2.) Your name is Sam Altman

[–] possiblylinux127@lemmy.zip 3 points 5 hours ago

How many Firefox tabs do you have open? Close Firefox and then look at ram usage

[–] passenger@sopuli.xyz 19 points 11 hours ago* (last edited 11 hours ago) (1 children)

Read this

https://www.linuxatemyram.com/

Edit: seems im in unused ram is wasted ram camp

I am too. Why not use your ram, you paid for it. Else you're writing to slow files and and caching things. I'd gladly have everything I need in ram if it fits.

What I'm more concerned about is applications releasing ram when I need it back. If I start a game will the browser give back the ram? That's my only concern though

[–] bjoern_tantau@swg-empire.de 15 points 11 hours ago (1 children)

I'm in the unused RAM is wasted RAM camp. Unless I run into problems I don't care about memory usage. So in your case I would've kept playing unless I got constant stutters.

And I think KDE is surprisingly light. Especially compared to older versions.

[–] mantricx@lemmy.world 2 points 7 hours ago

I mean I think KDE is the heaviest it’s ever been, it just started out heavier than its competitors but grew slower. So it’s light enough now that we’re not using pentium 4 with 1GB RAM.

[–] castironfan@lemmy.world 9 points 10 hours ago

Use something like ps to list out what is using the RAM

You mention you closed Firefox and it didn’t change but you did not say how you actually measured it.

Start the system up fresh and run this command.

ps faux --sort=-%mem

Or

ps faux --sort=-rss

That will help you track down what is actually using it.

Note: browsers will soak up a ton of memory on modern systems as almost all of them sandbox tabs at this point. If you open a ton of tabs, that will be half your problem.

[–] fraksken@infosec.pub 31 points 13 hours ago (2 children)

Memory free ≠ memory available.

[–] daychilde@lemmy.world 6 points 11 hours ago

Memory free

Memory free? I'll take a half dozen!

[–] rounding_error@lemmy.today -2 points 13 hours ago
[–] HouseWolf@pawb.social 5 points 9 hours ago* (last edited 9 hours ago) (1 children)

You apparently can limit programs memory cap using cgroups. I haven't tried it however.

Wouldn't be the first....or 5th time I've seen Minecraft max out ram.

Me and some friends managed to crash a guys 64Gig server rack because the modpack my friend made had a bad memory leak.

[–] frongt@lemmy.zip 0 points 6 hours ago

Meh. My desktop has 64gb and I broke it this morning by loading too much stuff into RAM.

[–] RickyRigatoni@piefed.zip 6 points 11 hours ago (2 children)

"Unused ram is wasted ram" is the worst argument I ever heard because that ram is so I can run MORE THAN ONE PROGRAM instead of some SHITASS WEB BROWSER taking all of it.

If I wanted to go back to the days before multitasking OSes when all ram was taken up by one program cuz you could only run one I'd install FreeDOS. Sick of this shit.

[–] castironfan@lemmy.world 19 points 10 hours ago (1 children)

That saying is because “unused RAM” is RAM that is not being used for buffers or cache.

That RAM is quickly freed for applications when it’s requested.

[–] RickyRigatoni@piefed.zip -1 points 10 hours ago (1 children)

You're gonna have to point me in a direction that explains this concept to me. I haven't picked up an A+ certification book since 2012.

[–] castironfan@lemmy.world 9 points 9 hours ago

Someone posted this earlier and it’s a good explanation

https://www.linuxatemyram.com/

Here is an Ug level explanation if you want something shorter:

Disk slow, memory fast (even compared to an SSD)

If memory fast, why no use memory

Some things load from disk often but slow to wait. Load from disk in advance and keep in memory so fast. Now use memory better.

If not enough memory we let go of other thing to run program.

How work? Magic.

[–] morto@piefed.social 2 points 6 hours ago

People keep saying that, but my experience with low end devices says the opposite. The less ram things take, the better. Programs will gladly fill the "unused ram", but won't give back as easily, and when we need to open something else, the oom killer isn't fast enough, and the system freezes with the disk led flashing like crazy, so we have to restart the system and lose recent activity. Unused ram is wasted ram my ass. It's easy to say that when you have the ram to spare, but without a bit of free unclaimed space, the system goes to shit very often

[–] anamethatisnt@sopuli.xyz 13 points 13 hours ago

What does the following commands show?

df -h -t tmpfs  

free -h
[–] frongt@lemmy.zip 10 points 13 hours ago (1 children)

Like half the lines in that screenshot say Firefox, so I'm gonna guess it's mostly that

[–] rounding_error@lemmy.today 3 points 13 hours ago

Yeah I thought so too. I saved about 1 GB after I took this screenshot by closing Firefox.

[–] MangoPenguin@lemmy.blahaj.zone 2 points 9 hours ago

What processes were using all the ram? I'm curious if there was one huge one or if nothing seemed to be the culprit specifically.

[–] Zen_Shinobi@lemmy.world 3 points 10 hours ago

Specs?

Terraria is hardly resource friendly. What were you doing on FF, livestreaming?

Installing zram seems to me you have low end specs. You need a lightweight DE

[–] chillxjr@lemmy.world 7 points 13 hours ago* (last edited 13 hours ago)

my debian KDE processes all together idle at around 2.5 gb, you must have a crapload of autostart background processes?

when I have youtube in firefox open, that takes up 4 gigs by itself

[–] LodeMike@lemmy.today 6 points 13 hours ago

If you have a trillion tabs open it's a trillion applications, not one.

[–] lemmyng@piefed.ca 5 points 12 hours ago (1 children)

buffered/cached memory shows separately

Some of it does. Let's try an experiment: does the reported amount of used memory drop if you run the following command?

sudo sh -c 'echo 3 >  /proc/sys/vm/drop_caches'

(obligatory don't blindly trust commands from strangers, type them out instead of copy/pasting, yaddayadda)

[–] rounding_error@lemmy.today 3 points 12 hours ago

I think my buffer/cache fell 8GB and my available rose 0.8gb

[–] thingsiplay@lemmy.ml 3 points 11 hours ago

Sounds like a memory leak. Is it really KDE? Maybe its the browser or some kind of service running in the background. If memory got leaked out of the app, that it doesn't matter if you close the app or not, because those are ghost memory now. I had this issue with a local Ai program just yesterday. It doesn't matter if I close everything, somehow the memory usage shows high amount; because a software leaked and it was not KDE, as this was reproducable.

My point is. you might not know where this leak come from without careful analyzing it. You can't just conclude its KDEs fault because you don't know why this happens. You should investigate which program does that.

[–] underscores@lemmy.zip -1 points 6 hours ago

KDE is bloated and buggy af. it's the first DE I used as a beginner and the bugs were just too much for me

[–] Die4Ever@retrolemmy.com 4 points 13 hours ago* (last edited 9 hours ago) (2 children)
[–] rounding_error@lemmy.today 1 points 12 hours ago

I agree, it makes much more sense

[–] mhzawadi@lemmy.horwood.cloud 4 points 13 hours ago

I would kill all Firefox processes and see if it's a memory leak, also free -mh will show you what's in use. Most nix systems will have a load of memory in caches

[–] UnfortunateShort@lemmy.world 2 points 11 hours ago (1 children)

You should use zwap with swappiness 100 if you want zram + swap. You can also enable and configure systemd-oomd (out of memory demon) if you actually run out of memory at times - it goes about things smarter than the kernel (for example killing processes that wait on memory all the time).

[–] Die4Ever@retrolemmy.com 1 points 9 hours ago* (last edited 7 hours ago)

yea, absolutely DO NOT combine Zram with regular swap, in fact don't combine any different types of swap, they don't mix

[–] daggermoon@piefed.world 3 points 13 hours ago (1 children)

Try using ZFS. My RAM is often ~53 GB idle.

[–] 2ndDegreeOWO@lemmy.world 5 points 12 hours ago* (last edited 12 hours ago) (1 children)

That's just because ZFS's disc cache shows up as application-used memory, instead of disc cache memory. (Disc cache memory is often reported in system monitor tools as 'free' memory, because it can be freed up as soon as you need it. ZFS's disc cache works the same way, but it's not reported separately to the OS, so that makes it look like ZFS is using a shitload of RAM.) If it bothers you, you can set a maximum amount of RAM for ZFS to use, and that will clear it up. It will mean that your performance is slightly worse, though, because ZFS won't be able to use disc caching optimally.

[–] daggermoon@piefed.world 3 points 12 hours ago

Oh, it doesn't bother me. Unused RAM is wasted RAM after all. LMAO.

[–] BooBees@fedinsfw.app 3 points 13 hours ago

It’s called ram spreading, it’s out of control

[–] Sanctus@anarchist.nexus 2 points 13 hours ago

Firefox memory leak?