49
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 17 Jan 2026
49 points (98.0% liked)
Linux
57274 readers
1257 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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS






Don't run swapoff if everything in swap may not fit in RAM.
Hence:
If it's like the last htop image should be no problem.
Turning off swap could make things much worse though. The system will have less memory for file caches.
I'd leave swap alone, just monitor for whether the system is paging frequently. "vmstat 3" should show if you're writing to swap frequently.
How so, given that we immediately re-enable the same swap device right after so that it's only off for a very brief moment? Let go :)
Anecdotally, this maneuver can help tremendously tonrecover responsiveness in some cases. I guess the overall sitiation could be improved by tweaking
vm.swappiness.See that
buff/cachecolumn? That's memory being used by the system for caching. Files you you open and access get cached into memory as do inodes, filesystem objects, etc. If you run a "find / -type f" twice in a row the second one will be significantly faster because the first run cached a lot of objects into memory.By starving the system of memory all that will be flushed and you get more disk access doing things you're actually trying to do. Whereas things sitting in swap are there because they aren't currently needed.
By turning off swap and then back on again you're just forcing the system to drop all that cache which it will then attempt to reclaim space for and push things back out to swap.
I don't know what benefit you think you'll gain in the process.