23rd Mar, 2015, 10:03 PM
I am using the RPi model B (512MB) for which 'free' reports 366012 KB of total available memory. I have experienced occasional problems with audio/video freezing and stuttering on Xbian (particularly on 1080p streams) and I have determined that this is due to aggressive swapping the SD card and the swap thrashing that results. I reduced swappiness in /etc/sysctl.d/00-xbian to 'vm.swappiness = 20' and most of the video problems went away. It also seems as if apt occasionally starts to check for updated software (because of cron?) and gets stuck, never terminating.
Also, to minimize swaps to the slow SD card, the zram module needs to be added to the system and a small zram-based swap should be set up with a higher priority than the SD card. Combining these two changes will eliminate most of the unnecessary swapping overhead and improve the system's overall responsiveness. Unfortunately, the kernel in Xbian doesn't have zram available, preventing me from easily adding it to my own installation.
Also, to minimize swaps to the slow SD card, the zram module needs to be added to the system and a small zram-based swap should be set up with a higher priority than the SD card. Combining these two changes will eliminate most of the unnecessary swapping overhead and improve the system's overall responsiveness. Unfortunately, the kernel in Xbian doesn't have zram available, preventing me from easily adding it to my own installation.