VIDEO: How to Change Swappiness in Ubuntu
Is Ubuntu feeling sluggish? The fix might be as simple as changing one number.

Let’s talk about your computer’s memory, specifically, how Ubuntu manages it. When your system runs out of RAM (the fast, short-term memory your apps use), it starts moving less important data to the SWAP space (a slower backup area on your disk).
By default, Ubuntu sets swappiness to 60 (on a scale of 0 to 100), meaning it’s pretty aggressive about swapping data to disk. But the thing is, RAM is way faster than even the quickest SSD. So, if your system is constantly shuffling data in and out of swaps, things can slow down.
That’s why many users tweak this setting, especially if they have plenty of RAM (say, 8GB or more). Lowering swappiness (to say, 10) tells Ubuntu to only use swap when necessary, resulting in a snappier system.
How to Change Swappiness in Ubuntu
Step 1: Check Your Current Swappiness Value
Open a terminal and run:
cat /proc/sys/vm/swappiness
This shows your current setting (likely 60, if you've never changed it).

Step 2: Edit the Configuration File
Let’s make the change permanent. Open the config file with (enter your password after the command):
sudo nano /etc/sysctl.conf

Video Script & Editing: Kelechi Edeh / Techloy.com | Content Research: Oyinebiladou Omemu / Techloy.com
Step 3: Adjust the Swappiness Value
Scroll to the bottom and find vm.swappiness
. If it exists, change its value to 10. If not, add this line:
vm.swappiness=10

Step 4: Save and Apply Changes
In nano, press: Ctrl + X
→ Y
→ Enter
to save. Then reboot the system when you're done.
If you don't want to reboot, you can apply the changes directly by entering:
sudo sysctl -p

Step 5: Verify the Change
Check the active value again:
cat /proc/sys/vm/swappiness
It should now say 10.

Conclusion
You don't necessarily have to change your swappiness, but if you’re on a low-RAM system (like 4GB or less), keeping swappiness too low might cause crashes when RAM fills up.
But for most modern machines with 8GB+ RAM, 10 is a decent spot; it keeps your system fast by minimizing unnecessary disk swaps. If you want to experiment, try values between 10–30 and see what feels best.
Image credit: Oyinebiladou Omemu / Techloy.com
