Can't create swapfile

I’ve tried through the drive-manager and no luck. Tried on both eMMC and external SSD and nothing happens. I just had an issue where I believe the whole system ran out of ram so threw everything out as none of my applications are accessible (plex, sonarr etc) and htop shows very little processes.

SWP in htop shows as 0k/0k all the time as well

Anything I can do?

Hi,

many thank’s for your request. To be sure you are running out of memory, you could run free -m to check memory usage.

To create a swap file, you could try following

/boot/dietpi/func/dietpi-set_swapfile 512 # Sets swap size to 512 MiB
/boot/dietpi/func/dietpi-set_swapfile 0 # Removes the swap file completely

Only problem is with a swapfile is it will increase read/writes to the SD Card immensly

Hopefully they will have the ZRAM and ZSWAP option implemented very soon

A first basic implementation of ZRAM will be done with next release. ZSWAP will take some time :slight_smile:

https://github.com/MichaIng/DietPi/issues/3743#issuecomment-682158346