REPRODUCIBILITY: Configuration issue, can be checked any time
OS VERSION: 18.104.22.168 (since introduction of 10 III)
HARDWARE: 10 III (10 II to lesser extent)
UI LANGUAGE: Any
REGRESSION: Yes, compared to Xperia 10 or earlier devices
So SFOS has patched device configuration provided by Sony so 10 II has 6x higher minfree values that default and 10 III has 12x higher.
In both patches it has been described that it is so Android apps don’t all get killed before any native app is killed.
But I think there has been a slight misunderstanding.
All Sony devices have this line:
ro.lmk.use_minfree_levels=true which means that increasing values for system-wide
lmk will also increase values for the Android only
lmkd. Here is relevant article from google: Low Memory Killer Daemon | Android Open Source Project
This all means that Android apps still get killed first, just less total RAM is used.
In another thread we discovered that reducing those values lead to over all better system responsiveness. And Android apps don’t get killed too quickly.
I have 2 suggestions then:
- If the values don’t actually do what expected, could they get lowered at least to Xperia 10 II levels? But I would personally remove those patches and go back to Sony’s default values, which worked well on older devices
- If developers of SFOS want Android apps to get killed later, maybe they should manually configure
lmkdto have lower values? But then again,
lmkcould be lowered, as they no longer need to be that high.
Could it simply be set to the values 10 II uses, which were chosen by testing? We confirmed those values also provide the best ballance between native and Android, more RAM has nothing to do with it
Warning for people testing it
It seems like
lkmd doesn’t take new values set for
lowmemorykiller immediately, so for testing I manually edited
/vendor/etc/init/init.lena.rc. But maybe all you need is restarting AlienDalvik.
So when booting with stock config, and then setting
minfree really low I could replicate Android apps being closed and reloaded too often, but when I set them in
init.lena.rc all worked fine.
Edit: Thaodan explained that
lkmd doesn’t use minfree values, so I crossed out those parts. It doesn’t change the problem and solution though.