Apps (particularly Android apps) have been crashing due to low memory, typically with only 6 apps open (2-3 native + 2-3 Android). Normally an Android app goes unresponsive and eventually dies. Usually closing a few apps will enable it to restart sucessfully.
Two options:
Change the zram settings to increase proportion of zram usage
Add a swap file/partition
I’ve been investigating changing the zram settings, I can’t find any info on this since Sailfish 2.x, I’m running Sailfish 4.x and everything is different so I dont know where this is configured anymore.
As a quick and dirty I tried adding a swapfile using swapon and everything is running much more smoothly:
This ‘swapfile orkaround’ -which I tried a few years ago, and sometimes try again- leaves me always (after some time) with a completely frozen device. I need to shut it down with vol+ - power button combi.
That worked on N900 flawlessly but on SFOS not.
Regarding option 1:
You can increase the default zram swap size by editing /vendor/etc/fstab.pioneer (that’s for XA2, the suffix may be different on other platforms). Just change the zramsize option in the last line and reboot (note: this modification will not survive OS updates).
Yes, terrible.
But how terrible a system is that kills all your running applications (or quite a lot of them) just when you open the camera or the browser (and having open only a handful of apps like settings, console, browser, mail, okay maybe also WA)???
On a device/phone with 3GB memory!
Well, that is all computers these days. Also, modern PC/Laptop SSD is different from internal phone storage, quite resistant to wear by many small writes.
I wonder if putting a swap partition on SD card would be better. Yes, performance will suck, and yes it may kill the card at one point. But it’s easy and cheap to replace, contrary to internal phone storage.
However, my experience so far (only a couple of days) is that the swapfile is only being used occasionally and the max usage I’ve seen is ~200Mb - but I have a learned habit now of closing apps to prevent issues, only leaving open super-frequently used apps. Maybe I wont do that anymore…
I’ll see how it goes, then I’ll experiment with increasing the zram instead and see if I can find a better balance with that. Apparently the theory is it’s faster - sure accessing the swap is faster because it’s in RAM but surely the CPU is working overtime compressing and uncompressing constantly?
Originally I tried adding to /etc/fstab but that was when I had the issue. Hesitant to try again because even testing re-mounting everything seemed ok before a reboot. Trying to get into and back out from Recovery mode was a nightmare!
This unfortunately can only be fixed either by optimizing the system (which clearly goes in the opposite direction so that’s not an option) or by increasing the amount of available memory. I’m sure the next device is going to require at least 4 or 6 GB of RAM. That’s the way it goes. Must be a law of nature
The app (komoot) runs for a while in background, but at some point, when I reopen it, it appears to be freshly started/reset.
Would those be symptoms of crashed/forcefully stopped android apps? I have not yet found a way to have the app run for a longer time in the background, it reliably crashes/resets after around 15-30min in the background.
On a 10 ii that is.
I don’t have any other apps except Fernschreiber running, and on the android side only MicroG. So I am not sure how this could be caused by memory issues? What do you guys think? Is there a way I could figure out if it was caused by memory issues?
Maybe I could just start a bash loop which prints memory usage into a file every x seconds and see how it went during the crash?
Arghh, can’t edit original post to keep this info together.
Anyway, another full days usage and the worst figures I got were:
free -m
total used free shared buff/cache available
Mem: 3556 3089 53 27 412 446
Swap: 2047 1923 124
That was with deliberately heavy usage, 6 native + 6 big Android apps running.
No app crashes so far, but I have noticed some delays (1-2 seconds) switching between apps before the screen reloaded. Looking good so far with the extra 1GB swap. Could probably reduce it to 512MB, that would have been sufficient 90% of the time. Will keep going another couple days and then try increasing ZRAM and report findings back here.