2.041-2016-12-12 Raspberry Pi out of disk space due to swap

Hi!

Referring to raspberry-and-volumio-979-not-responding-t4618.html

Was there something fundamentally bad about 80M?

Because the current latest commit for dynswap.sh (d2c83bf) says fallocate -l 512M.

Problem is, I ran out of memory again when I updated Volumio. Couldn’t even check any logs for messages,
because Volumio couldn’t write any, the disk being out of space.

I went in, disabled swap and deleted the swapfile, otherwise nano would not have disk space to save
the edit to make dynswap.sh say fallocate -l 80M.

So that’s why I’m asking, was there a problem with that amount or what, because this broke for me.

Thanks!

Surely the answer here is to use a larger capacity card??

1- How big is your SD Card?

4G, ie. 3.7GiB.

So there is space on the SD card, it’s not about that. It’s the overlay file system that gets filled up by the swap file.
This is what it looks like with a smaller swap file:

volumio@volumio:~$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mmcblk0p2               2.0G  497M  1.4G  26% /imgpart
/dev/loop0                   247M  247M     0 100% /static
overlay                      354M   95M  232M  30% /
devtmpfs                     233M     0  233M   0% /dev
tmpfs                        242M     0  242M   0% /dev/shm
tmpfs                        242M   29M  213M  12% /run
tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
tmpfs                        242M     0  242M   0% /sys/fs/cgroup
tmpfs                        242M   16K  242M   1% /tmp
tmpfs                        242M     0  242M   0% /var/spool/cups
tmpfs                        242M   80K  242M   1% /var/log
tmpfs                        242M     0  242M   0% /var/spool/cups/tmp
/dev/mmcblk0p1                61M   29M   33M  47% /boot
192.168.1.2:/mnt/sda1/music  1.8T  1.5T  339G  82% /mnt/NAS/Music
tmpfs                         49M     0   49M   0% /run/user/1000

Therefore dropping the swap file size to 80M has two benefits:

  1. It never tries to churn the slow SD card full of swap data, though fortunately vm.swappiness is set to a low value, so this is less likely.
  2. It fits on the file system :wink:

Thanks!

Hi!

For what it’s worth, I upgraded the Volumio yesterday to the latest build (02-03-2017) and there
was no problem with the swap file.

I can’t be arsed to adjust the size right now if only the swappiness setting makes it behave better,
but 512MB is way too much swap for a MicroSD and much more than Volumio requires. Can’t
help but wonder why the size was reverted to this much.

Anyway, considering this closed now, I’ll post something in a new thread if I start experiencing
swap-related deaths or any other issues.