this post was submitted on 21 Mar 2025
12 points (100.0% liked)

Linux

9366 readers
166 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 2 years ago
MODERATORS
 

Hi guys!

I have what I'd consider a beefy gaming PC. AMD 7700 CPU, 32GB RAM, 7800XT 16GB, NVMe 1TB for OS, mSATA SSD 2TB for storage/games.

So...whenever I get a while using the computer, with a bunch of windows open, say firefox taking 4GB of RAM, total for everything a bit over 16GB...I'm prone to get a whole system slowdown/freeze, which can take a few full minutes until it settles. I can see the storage red led on the whole time without blinking, so it really looks like swapping.

However sometimes I don't see movements in the system process viewer, in usage from RAM/swap, I'd imagine those graphs would change if the data in swap has changed.

Swapping is set in the mSATA, taking 8GB, so I reckon that migth not be the fastest. Still, that's an SSD. I'm not sure how can I check/troubleshoot whatever is tanking my computer performance?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 22 hours ago* (last edited 22 hours ago)

Been enjoying Linux for ~25 years, but have never been happy with how it handled low memory situations. Swapping have always killed the system, tho it have improved a little. It's been a while since I've messed with it. I've buckled up and are using more ram now, but afair, you can play with:

(0. reduce running software, and optimize them for less memory, yada yada)

  1. use a better OOM (out of memory) manager that activates sooner and more gracefully. Search in your OS' repository for it.
  2. use zram as a more intelligent buffer and to remove same (zero) pages. It can lightly compress lesser used memory pages and use a partition backend for storing uncompressible pages. You spend a little cpu, to minimize swap, and when needed, only swap out what can't be compressed.
  3. play with all the sysctl vm settings like swappiness and such, but be aware that there's SO much misinformation out there, so seek the official kernel docs. For instance, you can adapt the system to swap more often, but in much smaller chunks, so you avoid spending 5 minutes to hours regaining control - the system may get 'sluggish', but you have control.
  4. use cgroups to divide you resources, so firefox/chrome (or compilers/memory-hogs) can only use X amount before their memory have to swap out (if they don't adapt to lower mem conditions automatically). That leaves a system for you that can still react to your input (while ff/chrome would freeze). Not perfect, tho.
  5. when gaming, activate a low-system mode, where unnecessary services etc are disabled. I think there's a library/command that helps with that (and raise priority etc), but forgot its name.

EDIT: 6. when NOT gaming, add some of your vram as swap space. Its much faster than your ssd. Search github or your repository for 'vram cache' or something like that. It works via opencl, so everyone with dedicated vram can use it as super fast cache. Perhaps others can remember the name/link ?

Something like that anyway, others will know more about each point.

Also, perhaps ask an AI to create a small interface for you to fiddle with vm settings and cgroups in an automated/permanent way ? just a quick thought. Good luck.