Forum

Full Version: Swappiness needs to be reduced and zram swap added
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Zram swap is enabled by default, or at least it was.
Zswap is enabled, zram is no more supported on raspi kernel
Are you completely sure that swapping is the culprit? I ask because there recently have been some problems with stuttering in some x264 files. This has already been fixed upstream in the latest raspberry pi firmware, but that hasn't found its way yet to xbian stable. More info: http://forum.kodi.tv/showthread.php?tid=215399

If it really is a lack of memory, then it might be easiest to just remove xbian-package-splash. That should free more than 25MB (RSS!) at the cost of some eyecandy:
Code:
1697 root      20   0 38160  28m  596 S   0.0  7.6   0:00.81 splash-daemon

Apt will complain that it's an essential package, so do it at your own risk. Personally I haven't noticed any side-effects yet other than that the Dim screensaver actually shows the terminal as background rather than a solid black.
* double post *
I'd like to check zswap behaviour but debugfs seem not supported in kernel and, as I undestood, it's necessary to examine zswap
Reference URL's