Hello everyone, I have a problem with my swap partition, (it is not being used), I don’t know why this happens, I have a 7GB partition for swap, and I have configured the swapinness in /etc/sysctl, I set it to 90% and nothing happens, the free -h command shows me that 0B has been used, and that I have 7.1GB free, try to turn off the swap using the swapoff command, then activate it and it tells me the following: swapon: /dev/mmcblk0p4: swapon failed: Device or resource busy, I hope you can help me
I am using Manjaro Linux, kernel: 6.11.11-1-MANJARO
swap helps with the performance of the ram memory, to manage it better, also I don’t understand why I have a swap partition that is not used, I would like to use it to see if it really helps with the performance
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=F85A-9A74 /boot/efi vfat umask=0077 0 2
UUID=ab0aaa2b-a95c-4235-97ee-ca07933fb53b / ext4 defaults,noatime 0 1
UUID=c5244109-b0a6-4f39-bfe0-cffd147c5cdd /home ext4 defaults,noatime 0 2
UUID=7e856b9f-b4b7-4033-92d3-9ad374265986 swap swap defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
You have misunderstandings what is what. Not needing to use swap is good. Cause the disk is a lot slower than ram. So if you have enough ram it will not be used.
Exactly the same here! Except I have 3 games installed:
Starcraft II;
Cities: Skylines; (yeah, I played it a long time ago. So long, I forgot whether it’s “Cities: Skylines” or “Skylines: Cities”, but I suspect the former); and
Contraption maker (like the old, almost ancient now, game “TIM”).
Btw, swappiness 90 which the OP has customized from the default 60 makes exactly the opposite of what the OP expects - it tells the system not to use swap unless ram is 90% full. And yet it does not matter that much as in manjaro other kernel parameters are set too, so it is pretty much the default to try not to use swap if possible. Which is good for performance and ssd health.
For the record, mine is almost always 0 in light usage scenarios, even with 8 gb ram.
I’ve set up the laptop of my wife almost three years ago with Manjaro. It has 16 GB too with out Swap.
She’s not a gamer, but she’s one of the people having 20+ tabs open in browser.
Not a single issue about low memory reported by her so far. Otherwise it would be a major incident here
Quite often the case but I’d always recommend having at least some swap, as a safety net.
free -h
free -h
total used free shared buff/cache available
Mem: 7.5Gi 5.0Gi 460Mi 630Mi 3.0Gi 2.4Gi
Swap: 15Gi 256Ki 15Gi
In my case I have extra swap defined, as it’s likely the system will have a RAM upgrade at some point (same with the other machine). I also do depend on hibernate being functional.
a ratio of how costly reclaiming and refaulting anonymous memory is compared to file memory.
You should read the link @Mirdarthos posted, specifically the section titled “What should my swappiness setting be?” (which is where the quote came from).
A value of 90 will tell the system that the cost is nearly equal (anon_prio=90, file_prio=110), so it will try to drop file cache less and swap anonymous pages more. A lower value (for swappiness and therefore anon_prio) biases the system towards dropping file cache rather than swapping anonymous pages.
Same here, only with 32GiB in the desktop and newer laptop, but only 8GiB in the old laptop. Which is so old and slow (1.5Mhz 2C/2T) one doesn’t want to run more than one thing at a time.
Haven’t used swap in I can’t remember how long. Well over a decade, perhaps two. I just throw as much RAM as I care to afford into the box and call it good.
I do all of that – though, kMahjongg and a few (free) Steam games hardly qualifies me as a gamer. Even if hibernation isn’t desired it’s always best to have someswap rather than none.
The recommended Manjaro defaults are fine in most scenarios, but even with greater than average RAM (64GB in my case), I’m more comfortable with knowing swap is available when it’s needed;
even if that need is infrequent.
I would suggest Members avoid propagating the blanket falsehood that swap is not needed, as the need for swap depends greatly on any given use case.
Well, I come from the opposite vantage. To paraphrase your words, I would suggest that members refrain from pointing out that someone doesn’t have any swap as a knee-jerk response, as if not having swap would by definition be the cause of someone’s problems.
Fair point. Neither she nor me are using that function. And at least for her no RAM upgrade is planned. She would rather get a new device with more RAM
Actually, it’s a valid thing to point out. It is of course up to the individual (and dependent on their use case) as to whether or not they choose to act on it.
I might often mention, for example: “You might wish to attend to swap; you have none defined.” There are those who then evaluate their need for swap, and others who simply ignore the comment.
Then there are the increasing number of … newer Members to consider, who somehow manage to miss the opportunity to configure swap during install.
There are some that tend to pounce on the absence of swap as a cure for all ills, if it is missing; that’s another blanket response that could use some taming.