this post was submitted on 11 Apr 2025
44 points (95.8% liked)

Linux

6920 readers
304 users here now

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of [email protected] and The GIMP

founded 2 years ago
MODERATORS
top 19 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 4 hours ago

Nobody's mentioning putting laptops into deep sleep where no battery power is being used.

[–] [email protected] 4 points 6 hours ago

Swap is super helpful if you’re running a web server on a 1GB RAM 2 CPU Linode instance!!

[–] [email protected] 20 points 23 hours ago (1 children)

As an admin, I prefer no swap on prod machines because I'd rather have the oom killer kill a process that will automatically be brought back up or replaced than grind everything to a crawl swapping. A dead process can be restarted. A swapped to death server can be challenging to even get into.

[–] [email protected] 11 points 20 hours ago

EarlyOOM is great for keeping systems responsive. I can't understand why the default memory management on many distros still seems to be "do everything possible to avoid automatic termination of processes even if that means the system becomes borderline unusable." It makes for a terrible user experience, and most users are just going to restart the machine when it happens rather than try to struggle through a slide show to manually kill whatever's causing the problem.

[–] [email protected] 7 points 21 hours ago (5 children)

I was forced to enable swap because it I run out of RAM without swap then 95% of the time my laptop hard reboots. Adding a ton of swap fixed it.

My next issue is that sometimes it just hard-freezes. Zero warning, under no load, I can't even move the mouse. Linux on the desktop!

[–] [email protected] 1 points 50 minutes ago* (last edited 50 minutes ago)

My next issue is that sometimes it just hard-freezes. Zero warning, under no load, I can't even move the mouse. Linux on the desktop

You may want to consider fixing the system cache value.

https://lkml.org/lkml/2013/10/25/39

I use lower values than Linus suggested.

[–] [email protected] 2 points 15 hours ago (1 children)

I added a userland OOM and now my browsers or slack dissapears and I'm confused for 5-10 secunds every time. sometimes my editor or one of the lsp servers.

cspell also leaks like crazy

[–] [email protected] 1 points 4 hours ago

Oh how do I do this? Can you choose what processes it kills first even if they're not the worst offenders?

[–] [email protected] 1 points 16 hours ago (1 children)

I've had Fedora lock up on me a few times over the years, eventually some update fixes something pretty quick and it stops doing it. Tbf, I've had windows freeze on me far more all the way from '98 to XP to Vista to 8.1 to 10, I kinda just figured it happens sometimes.

[–] [email protected] 1 points 14 hours ago (1 children)

Nah this is like once a week. Windows (post XP) crashes on me maybe once a year. It's much more stable than desktop Linux in my experience.

[–] [email protected] 1 points 13 hours ago

It's been maybe once a year with Fedora (except that time it was three days before the update that fixed whatever the issue was, but then it was like three times and I pretty much count it as the same "incident"). Wish I could help, but short of knowing why all I have is "well that sucks bro." Maybe looking into your logs when it happens will help identify a specific problem that can be fixed, if you care to do so. If you like windows though just stick to windows, whatever.

[–] [email protected] 1 points 16 hours ago

I had this issue with System 76 with Ubuntu (for work). It was infuriating.

[–] [email protected] 1 points 18 hours ago (1 children)

What hardware did you use ?

[–] [email protected] 1 points 14 hours ago

Some Dell/Intel business laptop. Nothing exotic.

[–] [email protected] 7 points 1 day ago (3 children)

Mhm something doesn't add up (well atleast on my system)

The kernel’s swappiness option (a sysctl parameter ranging from 0 to 100) controls how aggressively the kernel prefers to swap out pages. A lower value tells the kernel to avoid swapping whenever possible, while a higher value allows more proactive swapping. The default value is 60, and you can check it using:

    cat /proc/sys/vm/swappiness

In other words, a low value (e.g., 10) means that the system prefers to keep things in RAM as long as possible. On the contrary, a high value (e.g., 80 or 100) tells the kernel to start swapping earlier to free up more cache.

I have 64 Gigs of RAM (only 8 are used by endeavour OS at all time), No Swap Partition yet my swappiness is at 60?

Is something wrong, even though I don't feel anything off, with my System O.o?

[–] [email protected] 3 points 8 hours ago (1 children)

Are you me‽

I put 64GiB of RAM in my mini desktop just to never have to deal with swap paging. AMD with integrated GPU, so it immediately steals, like, 4GiB for graphics, but even so I think I've never seen it go past 50% usage.

I think 60 is just a default. That's what mine says, too, and I have 0 swap allocated:

               total        used        free      shared  buff/cache   available
Mem:            59Gi        16Gi       2.1Gi        72Mi        41Gi        43Gi
Swap:             0B          0B          0B
[–] [email protected] 2 points 8 hours ago

very nice :)

[–] [email protected] 21 points 1 day ago

There's no swap, so swappiness has no effect.

[–] [email protected] 3 points 1 day ago

In some of my systems with a lot of RAM, I pre-cache as much as possible (DBs) and disable swap altogether.

Most people won't notice a difference, especially if you are running on SSD. That said, swapping will kill that SSD a lot quicker.