We have moved to a new Sailfish OS Forum. Please start new discussions there.
15

More Swap Space

asked 2015-06-18 16:39:38 +0200

cl_ix gravatar image

updated 2015-06-18 16:40:06 +0200

I'd like to either increase the swap space or create a swap partition with the MicroSD drive. Are either of these possible?

edit retag flag offensive close delete

Comments

3

I've increased the size of my zram block device which is primary swap on Jolla, so it is kind of possible. Second swap, which is a partition on internal flash drive would be kind of tricky to change in size because of btrfs file system on Jolla. With microsd it depends of what else you would like to do with it. If you want it to be only swap space, just type in terminal logged as developer mkswap /dev/mmcblk1 and then swapoff /dev/mmcblk0p28 && swapon /dev/mmcblk1p1. If u would like to use it also as a storage, like I said earlier it depends...of a filesystem you choosed.

Mądry ( 2015-06-18 17:09:15 +0200 )edit
2

Perhaps time to clarify: apparently, ../etc/default/zramcfg is deprecated, as well as ../usr/sbin/zramswapon Right?

I couldn't change the size of /dev/zram0 and /dev/zram1, both 64Mb each according to swapon (running Aaslakkajärvi)

Maybe there is a rule allowing to optimize swap space according to available storage space and memory required by the most demanding applications (web browsers for instance), plus a simple method to adjust it (without even trying to use microSD memory instead of internal storage).

objectifnul ( 2015-06-18 21:20:38 +0200 )edit
2

The config in /usr/sbin/zramswapon still works. I've just changed default 100MB zram to 500MB without a problem and I'm running latest u16 (Aaslakkajärvi). I think its worth trying out first if you want to speed up your Jolla. I'm using this config without much problems since January and first hiccups and ui hangs appeared today after update to Aaslakkajärvi which reset my zram setup to default 100MB block size. Without you asking this question today I propably woudn't find out. Thanks :D

Mądry ( 2015-06-18 22:58:58 +0200 )edit

In zramswapon, I tried various values for the "20" factor in the line "SIZE=$(( $MEMORY_IN_KBYTES * 1024 * 20 / 100 / NUM_ZRAM_DEV ))". As far as I didn't make mistakes, this doesn't modify the size of swap blocks. Of course, I am far from understanding in detail how this thing works...

objectifnul ( 2015-06-18 23:30:42 +0200 )edit

Reboot ? How do you save the results ? Maybe you have no rights to saves the changes ? And why so small value like 20 ? It will give you around 150MB zram device (only 50MB more in comparison to stock). I would go with around 30-35 which should give some real speed improvement ;)

Mądry ( 2015-06-18 23:40:15 +0200 )edit

1 Answer

Sort by » oldest newest most voted
7

answered 2015-06-18 23:43:20 +0200

cl_ix gravatar image

Per Madry's reply, I edited /usr/sbin/zramswapon with the nano editor. I first installed nano with devel-su pkcon install nano then entered devel-su nano /usr/sbin/zramswapon to open the file in nano, went to the line

SIZE=$(( $MEMORY_IN_KBYTES * 1024 * 13 / 100 / NUM_ZRAM_DEV ))

and changed 13 to a higher number (in my case 78). After saving the file and rebooting the phone, I now have more swap space (~1GB) reported by /usr/bin/free.

Cross reference:

https://together.jolla.com/question/77183/how-to-change-zram-size/

edit flag offensive delete publish link more

Comments

3

I thought I went insane setting my value to 60. Did you ever use that much of it ? I learned to not exceed the size of 400MB of used zram to avoid slowdowns and hang-ups. I was monitoring the zram usage per process very often and it looks like the kernel likes to compress chunks of lipstick (ui process) assigned ram in low memory situations very much compared to other processes. It compresses so much of it that starting from lagging whole system usually ends up hanging for a while or even rebooting.

Mądry ( 2015-06-19 00:01:48 +0200 )edit
1

I have ran into OOM kissues after 1.1.9.28 early access, so I'm increasing 13% to 20% first and see if it helps. Thanks for the information, I'll be back...

Edit: Well! I only started Browser, Settings and aliendalvik-running Facebook - zram already full. Let's try 50%...

Edit: 50% seems to be good, even though I can quite easily get it maxed out, if I want to. No apps killed, though... O let there be 2 gigs of RAM :)

Direc ( 2015-09-12 21:13:10 +0200 )edit

zramswapon must be a bfrst file system related file, dont have it in 2.0.5.6 running ext4 file system.

DarkTuring ( 2016-12-15 18:21:01 +0200 )edit

What device are you running?

Direc ( 2017-02-17 08:46:05 +0200 )edit
Login/Signup to Answer

Question tools

Follow
14 followers

Stats

Asked: 2015-06-18 16:39:38 +0200

Seen: 1,217 times

Last updated: Jun 18 '15