zramcfg (Configure zram)

Rating: 
5
Your rating: None Average: 5 (5 votes)

 

 

NOTE: zramcfg is not required anymore since SailfishOS 1.1.1.x (Vaarainjärvi/Update 10).

zram is now built-in in SailfishOS and properly configured.

 

NOTE: By installing zramcfg you'll pull out also the real zram module from my repository. If you are running Tahkalampi (SailfishOS 1.0.8), you need to install the older kernel-module-zram-jolla package.

This package provides zramcfg, a small utility that permits to automatically confgure the zram kernel module.

By installing this package, you will automatically download and install also the kernel-module-zram-jolla package. You should ensure to have my OpenRepos repository active, of course.

 

zram is used successfully by Android (4.4+), Chrome OS and also by some GNU/Linux distributions targeted at low-end machines, such as Semplice Linux and Lubuntu.

It permits to create a compressed swap file directly in RAM, providing huge performance benefits in low memory situations.

 

The installation of this package will enable zram by default, reserving for it ~130MB (16% of the available RAM) of the physical memory.

It's possible to change this value by editing the /etc/default/zramcfg file and then running the 'zramcfg' command line tool to update the configuration.

 

Obviously, this package is provided WITHOUT ANY WARRANTY. Use it at your own risk.

 

If you like my work, you can buy me a beer :)

 

 

Keywords:

Application versions: 
AttachmentSizeDate
File zramcfg-0.0.9-1.noarch.rpm5.33 KB09/09/2014 - 20:16
File zramcfg-0.0.10-1.noarch.rpm4.9 KB19/11/2014 - 20:31
Changelog: 

Raised size limit to 16%

Comments

objectifnul's picture

Time to explain that this is now deprecated, as recent SFOS releases include swap memory management. This utility may interfere with built-in swap management.

eugenio's picture

Done :)

olpe's picture

thank you

chuci's picture

With the default settings I'm very impressed so far. Going to leave it on for a few days and see how things go but looking good so far, anecdotally the interface is generally less laggy.

eugenio's picture

Thank you for the feedback!

Your battery life remained the same?

Schturman's picture

And reverse just by uninstalling both packages ?
And what about system updates ? it's affected somehow ? or we need uninstall before sys update ?

P.S. and after updating the file we need run command as root or user ?

Thanks

eugenio's picture

Yes, by uninstalling the zramcfg package zram will be disabled.

 

Theoretically it shouldn't do any harm with system updates. Obviously the zram module (kernel-module-zram-jolla) is compiled against the Tahkalampi kernel and so it will not load on Update 9's one. The system should boot just fine though (zram will not work of course).

 

After updating the configuration file you need to execute the command as root.

 

 

 

Schturman's picture

Thank you!

eugenio's picture

You're welcome! Please share your experiences with zram :)

minimec's picture

Still testing but I guess this is one of the most useful additions we have seen for our beloved Jolla. My zram configuration settings would be 33% right now. Thank you ... thank you ... thank you ...

eugenio's picture

You're welcome! But... 33%? That's much!

 

Let's hope by the way that after (extensive) community testing Jolla will include it in some upcoming update!

minimec's picture

<blockquote>33%? That's much!</blockquote>

That might indeed sound crazy, and yet the ubuntu zram init script would calculate a 512MB zram swap with 498MB physical memory available for a Toshiba ac100 ARM/Tegra 2 Netbook. On the Jolla 33% is a little bit below that '1:1' ratio (~1:0.95).

I am still testing... Maybe like 25% is a good middle value.

eugenio's picture

I wrote zramcfg for my GNU/Linux distribution and there I set the default to 25% and it works well.

 

I didn't know that the Ubuntu's init scripts makes it reserve so much memory for zram, IMHO is overkill.

 

As in my opinion SailfishOS is not that memory hungry, I lowered the value to 13%. zram is still a swap device, so I prefer to use physical memory as much as possible.

With that configuration, I managed to load ~29 applications without obivous lag.