How to add swap memory on Linux

Here were are going to create a 4GB SWAP memory. You can do this buy specifying a block size of 1GB with a count of 4. You can specify your own swap size.

sudo dd if=/dev/zero of=/swapfile bs=1G count=4

Enabling the Swap File
Make sure the file has proper permission.

sudo chmod 600 /swapfile

Now format the file so that operating system can understand this is a swap file .

sudo mkswap /swapfile

Now enable the swap memory

sudo swapon /swapfile

 

Hosting Ahead

Recent Posts

Run composer with different PHP version

If multiple PHP versions are installed on your server you need to tell the composer…

2 years ago

How to Install WordPress using WordPress Toolkit in cPanel

Wordpress toolkit allows the installation, configuration, and management of Wordpress. The first step is to…

3 years ago

Configure OpenVPN Client Devices for Andriod

These instructions cover installing and configuring the OpenVPN Connect app  Client-Side Configurations: Android There are…

3 years ago

The certificate chain was issued by an authority that is not trusted | SQL Server

This error may appear when you try to connect to Microsft SQL server or you…

4 years ago

Free website hosting support in this COVID pandemic

Hello everyone, The COVID-19 should have affected almost everyone in a way or another. When…

4 years ago

Amazon workspaces to build a secure work from home cloud infrastructure

Based on the current Covid19 scenario, several companies asked employees to work from home. Google…

4 years ago