What Is Swap Space In Linux?

New to Linux? Here's what Swap space and what it's used for.

Share on twitter
Tweet
Share on facebook
Share
Share on whatsapp
WhatsApp

So, you finally decided to switch to Linux from Windows. You search the internet for tutorials, and halfway through the installation process, you hear about the term “Linux Swap,” wonder what it is, and one search on the internet brought you to this article. Let’s look at Swap Space is in Linux and if it’s essential or not.

What is Swap in Linux?

Swap is similar to the memory expansion feature on smartphones recently made available by some manufacturers. In a nutshell, it uses the phone’s internal storage like RAM if the actual RAM runs out of space. Similarly, on Linux, Swap space keeps your computer from crashing by storing volatile data on its internal memory (HDD/SSD) if your physical RAM is full.

Creating Swap space is unnecessary to install Linux, but if your computer has less RAM and more storage space, you can salvage some to make some swap space as it might come in handy in some situations.

How much Swap is too much Swap?

So, if your computer has the characteristics that we mentioned above, it’s not a bad idea to create swap space, but the question is, how much should you create?

There’s certainly no limit to how much Swap you can create, but the common opinion is “Half the size of your RAM.” However, create Swap only if you’re sure that you will run memory-hogging programs and do lots of multi-tasking, or else you’ll essentially be wasting your storage space which you could have used to store something else.

How to create Swap in Linux?

Considering you’re already in the installer and created / and /home partitions, the next step would be creating swap space. All you need to do is create an empty partition of size depending on how much RAM you have (Minimum 2GB to 4GB of swap space if you have 8GB RAM). In the options, select “use it as swap” or any word that correlates to Swap and click on create. You can then go ahead with the installation process.

Find your dream job

Install Linux Mint - swap area

To make things easier, we have an article explaining how to dual-boot Linux Mint alongside Windows, where we’ve explained how to create Swap. So, make sure to check it out.

Do you have a swap partition installed in your Linux? Let us know in the comments section below.

If you like this simple explainer, check out our Short Bytes section. We take complex tech topics and break them into short, easy-to-understand articles.

Abubakar Mohammed

Abubakar Mohammed

Abubakar is a passionate tech writer whose love for tech started in 2011 when he got a Dell Inspiron 5100. When he's not covering Linux and open-source, you'll find him binge-watching anime or Tech content on YouTube.

Find your dream job

Work at your dream company with Fossbytes Jobs