How to: Increase swap on Raspberry Pi

Step 1: Temporarily stop swap on Raspberry Pi:

sudo dphys-swapfile swapoff

Step 2: Modify swap size on Raspberry Pi

sudo nano /etc/dphys-swapfile

Change CONF_SWAPSIZE to e.g. 1024 for 1024MB / 1GB.

Step 3: Re-initialize the Raspberry Pi’s swap

sudo dphys-swapfile setup

Step 4: Start swap on Raspberry Pi

sudo dphys-swapfile swapon

Note: I/O activity

Using swap can increase I/O activity on the MicroSD card increasing chances of shortening the lifespan of the card.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top