Skip to content

Instantly share code, notes, and snippets.

@rampfox
Created June 24, 2022 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rampfox/8bd67b1a7b2e61ad0a15df12f67e5470 to your computer and use it in GitHub Desktop.
Save rampfox/8bd67b1a7b2e61ad0a15df12f67e5470 to your computer and use it in GitHub Desktop.
tutorial How increase SWAP memory size in Raspberry Pi

increase SWAP size in Raspberry Pi

What is SWAP memory?

SWAP memory is basically parts of memory from the RAM (Random Access Memory) that enables an operating system to provide more memory to a running application or process than is available in physical random access memory (RAM). So if the physical memory (RAM) is full, we can use SWAP partition for extra memory resources. It is useful if we have low memory on our machine.

Step 1: Stop the SWAP

sudo dphys-swapfile swapoff

Step 2: Modify the SWAP size

As root, edit the file /etc/dphys-swapfile and modify the variable CONF_SWAPSIZE:

sudo nano /etc/dphys-swapfile

Edit the line and enter decide swap size in MB CONF_SWAPSIZE=1024

and save ^ + x

Step 3: Create and initialize the file

Run

sudo dphys-swapfile setup

Step 4: Start the SWAP

sudo dphys-swapfile swapon

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment