I’m running OSMC on a rpi2.
I have quite a few addons and a fairly complex skin as I depend on the functionality these provides. So I can’t really change any of this. Of the 1GB ram the rpi2 has I have dedicated 256M to graphics.
The problem is I keep running out of RAM so OSMC keeps crashing, it happens a few times every day. Since upgrading with more RAM is not possible, and adding swap to a flash card is not feasible, I thought I would try zram.
For those who doesn’t know, zram is a Linux kernel module for creating a compressed block device in RAM, i.e. a RAM disk, but with on-the-fly “disk” compression. The block device created with zram can then be used for swap or as general-purpose RAM disk. Since it’s typically compresses to a 3:1 ratio the RAM configured for use by zram will essentially be tripled. And since swapping to RAM is fast, almost as fast as keeping the pages in memory, this is a very efficient method of making the most out of hardware with limited RAM.
Anyhow, it seems like zram is either removed or not included in the first place in OSMC. It’s available in OpenELEC and Raspbian, but can’t find it in OSMC. The command “modprobe zram” just gives this error message:
modprobe: FATAL: Module zram not found in directory /lib/modules/4.9.29-15-osmc
I find this old “issue” on github requesting that zram is added to OSMC:
THis ticket refers to a “pull request” (https://github.com/osmc/osmc/pull/338) that indicates that zram has indeed been added to OSMC.
And lastly these are the code changes that should have enabled zram support: [package] [kernel-osmc] Add zRAM support · osmc/osmc@2ee7eca · GitHub
But I still cannot get this to work, the zram kernel module is nowhere to be found on my up-to-date OSMC installation.
What happened here and how can I enable zram support?