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

Any chance that zswap has been added? I’m trying to do something with 512mb of ram and I need both compressed in ram and some swap to make it more reliable. That or I just need to know how to add a lower priority disk swap after using the zram option in dietpi-set_swapfile

Something you can have a look into. Zram and physical swap · MichaIng/DietPi · Discussion #6289 · GitHub

1 Like