this post was submitted on 04 Dec 2024
55 points (96.6% liked)

Linux

48624 readers
1332 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Not sure why that is, but I have 32 GB of RAM and I would like my system to utilize it as much as possible, but as you can see in the screenshot, the system is only using 5.66 GB of the physical RAM, but swap is still being used in a high number. Is this normal? Should I lower the swappiness to lower than 10? Should I let it be? Thanks
Here is the screenshot

you are viewing a single comment's thread
view the rest of the comments
[–] sgtlion@hexbear.net 12 points 1 week ago* (last edited 1 week ago) (2 children)

This is normal. This is a topic with a lot of complexities if you drill down into the details and history, but the tl;dr is certain system processes and other programs will preferably write data to swap because it's so infrequently needed, and avoids massive slowdown if swap is needed, eg RAM filling, hibernation.

If you're absolutely sure you'll never exceed 32gb of RAM usage, you can turn the swap off. But you're unlikely to notice a performance boost, Linux does (largely) know what it's doing, moreso than you or I.

The TankieTanuki link is a good place to start to learn more if you really want to tweak it.

[–] penquin@lemm.ee 2 points 1 week ago (1 children)

I'll leave it alone. Thank you so much. I just wanted clarification

[–] sgtlion@hexbear.net 2 points 1 week ago

For sure, and it's a chill question. Unlike the other comment, I totally celebrate your fucking about with settings you don't understand, it's great. I've practically made a career of it myself :D

[–] kevincox@lemmy.ml 2 points 1 week ago

To put it another way you want to be using all of your RAM and swap. It becomes a problem if you are frequently reading from Swap. (Writing isn't usually as much of an issue as they may be proactive writes in case more memory needs to be filled up).

Basically a perfect OS would use RAM + Swap such that the least disk reads need to be issued. This can mean swapping out some idle anonymous memory so that the space can be used as disk cache for some hotter data.

In this screenshot the OS decided that it was better to swap out 3GiB of something to use that space for the disk cache ("Cached" ). It is likely right about this decision (but is not always).

3 GiB does seem a bit high. But if you have lots of processes running that are using memory but are mostly idle it could definitely happen. For example in my case I often have lots of Language Servers running in my IDE, but many of them are for projects that I am not actively looking at so they are just waiting for something to happen. These often take lots of memory and it may make sense to swap these out until they are used again.