How can I optimize performance with ZRAM?

Let me start out by saying I’m a complete Linux noob, but I understand what ZRAM is and I’ve managed to get it running for swap.

I have a 4GB S905x3 device. Is using ZRAM for swap a complete waste? Even when streaming large 4k files my free mem stays above 2GB. Is there anything else I can mount to ZRAM to make the system faster and utilize the “wasted” 2GB?

The /dev, /run, /var, and /tmp directories are already using RAM. The /storage/.cache directory is very small and would have little effect on performance. I just think that more RAM can be used in the kodi configuration or as a timeshift for TV channels, especially in devices that use microSD. I don’t see any application to using ZRAM.

I am having a hard time imagining a use-case for ZRAM (and swap space, for that matter) in any 2GB+ CE device. Linux doesn’t waste any memory that’s not directly allocated by an application, but uses it for its own buffer cache. IOW, don’t bother.

BTW, I found the media coverage of CE’s latest release a bit overemphasizing the fact that now ZRAM was available, albeit only for non-ng. The resulting confusion among users (why did -ng miss out?) was expected.

Ah, thanks for the info. I already made an for 2GB of ZRAM swap using lz4 algo. Guess it doesn’t hurt to just leave it that way even if it’s never used?

It would be neat to have Kodi run from ZRAM, but I guess that would take some serious coding effort.

It’s working on -ng for me. I thought they both got it but only -ng has lz4?

Indeed, but the message was not entirely clear. To be fair, the release notes could have been less terse :slight_smile:

In any case, I doubt that you will notice a difference.

What do you mean by this?

I mean to run the Kodi install from ZRAM, like you would run a program from a RAMdisk on a PC. I’m not a coder, but I can just imagine it would be no small task.

You can use parameter toram which copies squashed SYSTEM file to ram and use it from there instead of SD card or eMMC.

Just add coreelec='toram' to file to file /flash/config.ini.

But I doubt you will see any improvement.

Thanks, I’ll see if I notice any improvement. I think most of the “slowness” in Kodi comes from it reading/writing to eMMC on my device. It’s abysmally slow. Even a USB 3.0 stick has faster speeds on the device than the internal flash.

zram is of ZERO benefit for 99.9 percent of CoreELEC users(and possibly a performance loss). It was only added to make a few users that felt they absolutely needed it happy for whatever extended use of the device they were trying to setup. So it’s disabled by default but there for somebody that wants to configure it.

However most should just ignore it. Since it’s really only for the few people who are trying to see just how many different things you can get to run on one of these devices at the same time.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.