Subscribe to Our Newsletter

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

VIDEO: How to Change Swappiness in Ubuntu

Is Ubuntu feeling sluggish? The fix might be as simple as changing one number.

Oyinebiladou Omemu profile image
by Oyinebiladou Omemu
VIDEO: How to Change Swappiness in Ubuntu
Image: Techloy.com

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: Check Your Laptop’s Battery Health on Ubuntu
Ubuntu’s hidden battery health checker reveals exactly how much life your laptop battery has left, and here’s how to use it.

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

0:00
/1:15

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 + XYEnter 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

VIDEO: How to Change Your Default Browser on Ubuntu
Switching your default browser on Ubuntu is easier than you think, here’s how to do it in just a few clicks.
Oyinebiladou Omemu profile image
by Oyinebiladou Omemu

Subscribe to Techloy.com

Get the latest information about companies, products, careers, and funding in the technology industry across emerging markets globally.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More