Tuning the oom killer / low memory killer

Absolutely correct! I didn’t think of that. Thanks for reminding me. (Now I can better understand why also Jolla didn’t it)

If you want to try, you can create a swap file following any guide for linux. Please be aware though that auto mounting a swap file on the encrypted /home partition via /etc/fstab does not work an will softbrick your phone on reboot! I suspect that the /home LUKS container is not unlocked at the boot stage where the system wants to swapon the file, leading to a hang during boot. As SFOS has no emergency console (to my knowledge), I know of no possibility to revert this than to reflash the phone. Speaking from personal experience…

You may be right about the potential flash wear issues. This is probably a risk you take with this approach. Given that the system uses swapfiles as last resort (as disk-based swap is usually much slower than actual ram) I think that the actual IO is limited. At least with my usage pattern, the swap is rarely used most of the time. The additional swap mostly serves to prevent the oom killer from reaping as there still is some free memory available.
It is an interesting idea placing it on a sdcard which you can simply swap in case flash wear issues occur. Giving the much slower IO rates of sdcards compared to the internal flash, I could imagine that some performance issues could arise when the system wants to use larger amount of the swapfile a once. But this are just speculations on my side, I have not (yet?) tested that.

3 Likes

What about killall s1p, instead? example:

sleep 100 &
killall sleep

There’s a recovery mode, and from there you can get a shell, mount the root partition and probably edit fstab by chrooting to that mount point. If you know how to create an auto-mount, you should probably know how to undo it (or learn :grin:).

Sorry, I may have been unclear there. SFOS generally has an emergency console for this cases, but at least the Xperia 10 II which I use has this feature missing, so I had no way of solving my error this way.

It has, but you have to “flash” the recovery from a computer. Actually you don’t flash it you just send it to the phone and tell it to boot it

A boot manager on the phone would be really great, that asks the user to boot the phone into normal mode or into rescue mode on powering up the phone, like a linux computer has it.

Surely this could easily be implemented, because /boot/hybris-recovery.img is present on the phone.

Worth a feature request? Or possible to be implemented by the community to not demand Jollas limited resources too much?

When booting the recovery mode on the phone and using a BT keyboard, then rescue operations could be done without having a computer.

1 Like

AFAIK, the recovery image is not present on the phone but delivered into the package. Unfortunately, it seems almost useless at least on Xperia 10 II

AFAIK, no because there is no a reasonable way to deal with the display after the recovery boot, e.g. cfr. yamui part in the link above. Even the telnet IP address is shown properly.


More in general

Does it still makes sense to tune the OOM low memory killer for the Xperia 10 III ? I often have the Sailfish browser open among at least 4 -5 other apps. The OOM makes them to close on a daily basis. This doesn’t happen on my other SFOS devices.

How much ram do you have on the other devices that have no issues?

There is much less RAM compared to Xperia 10 III and that’s the interesting thing. Xperia 10 puls = 4GB, Xperia XA2 ultra = 4 GB and Xperia XA2 plus = 6 GB (same as 10 III but 32bit system). Non of those older devices suffer from OOM kills as much as the 10 III.

which points to the major difference as the root cause, the introduction of 64 bit

I changed the minfree values on my 10 II to what was suggested here.

/vendor/etc/init/init.seine.rc:
#write /sys/module/lowmemorykiller/parameters/minfree “117160,140200,163240,186280,256490”
write /sys/module/lowmemorykiller/parameters/minfree “58580,70100,81620,93140,128245”

That seems to help somehow, but to be honest it is super hard to tell. The moment i open more that 3-4 apps or open one big consumer like an offline mapping app i am very likely to see things falling apart quickly. If i am lucky it will just kill something that i can start again, more often it will make the whole android subsystem die and needing manual restart.
And often the device somehow gets serious hickups (whole subsystems not working anymore, maybe some core services killed?) that will require a reboot.

This is another one of these threads where a lot of good information is around, but no definitive answer or fix. The whole concept of two OOM killers that do not know about each other seems totally broken, while other information suggests that the sailfish oom mce thingy is based on the wrong input in the first place … like including buffer caches which should maybe be flushed before going around like killall -9 style.

I am currently travelling and having mapy.cz or puremaps open is normal, any attempt to use them for turn by turn navigation will likely crash the app to my whole phone …

Another way to get into trouble is opening 3+ tabs in the browser and having a second android browser running for all the websites that the stock browser can not handle. And maybe whatsapp and email.

This needs to be solved or at least explained! I am not sure i would want to buy a 10 III just to see the same bugs show there. It might have more memory but that is only going to cut it for so long. Throwing more memory on the bugs is just covering them up, not solving them!

1 Like

I am not sure i would want to buy a 10 III just to see the same bugs show there.

10 II and III experiences are like night and day. I tried every trick in the book on 10 II, can confidently say it cannot be rescued.

Been daily driving 10 III for 4mo, and all that aggravating soul-destroying swap slowness mostly just doesn’t happen here.

While yes, ideally software would improve, one needs to check realities with Sailfish and Jolla’s velocity. More hardware, if it works well enough, is the clear winning choice.

My girlfriend has got a 10 iii and she says that only occasionally android support is crashing. Maybe this is because i installed play services, which made android support pretty much useless on my 10 ii. It needed literally 5mins to start an android app and then it was very slow. I use microg on my 10 ii now which is way more lightweight. It only adds maybe 1min to start of android support and then the apps are quite usable. Also encryption was too much for the 10 ii, where it sometimes or rather more often hang when decrypting the filesystem after a boot, i needed about 10 tries to boot the phone, which was very frustrating. With the 10 iii it just decrypts without a problem every time. Although there are some other things i don’t like about the 10 iii. That the triple camera support can not be enabled if you want to take selfies or the other way round. Also 10 iii uses only one of the two speakers, where the 10 ii uses both, although i could live with those two. Then often sound is disappearing for her on the 10 iii, which is quite frustrating during a phone call. I made a script, which you have to start after boot to restart sound with the assistant button, but she likes it more to run the command in qcommand, which i think takes more time. Also i would restart sound before every phone call and test it. This bug makes her very frustrated towards sfos. And then finally what i don’t like so much is that one cannot use a usb dac headset entirely on the 10 iii, whereas on the 10 ii i can use it for audio, but not for phone calls, which seems to be a bug in the whole os.

1 Like

So i like my 10 ii very much with the oled display, as it is, but i guess the best experience would be with an xa2 or this rugged volla phone with the highest amount of ram and the equivalent gigaset phone. I hope 10 iv and v will change things here.

I think this is clearly a software problem. I run SFOS 4.5 on a XA2 ULTRA (4G Ram) and observe OOM actions almost never, despite running several Android apps and browser with mutiple tabs (browser crashes sometimes, but appearently has nothing to do with high load)

2 Likes

I got the same feeling, almost no OOM on xz3 with 4GB RAM compared to frequent ones on 10iii.

quick side note: if you use OpenCamera in android, and just be careful not to switch to the broken upside-down-selfie lens, selfies and telefoto+wide lenses can be used without issue

Well maybe it is a bug on the 10 II, but it would be nice if it was fixed. The device is indeed more or less useless and i am not sure i can trust in others being better, or trust in that for the future.

The boot hang with crypt is super annoying. The trick is to just wait before entering the code and hitting return. I bet some entropy problems in that kernel or in the service files deps where the lockscreen comes up before the random generator comes.