REPRODUCIBILITY:
OS VERSION: 4.5
HARDWARE: Sony Xperia 10 iii
UI LANGUAGE: US
REGRESSION:
DESCRIPTION:
After a few hours the phone does not ring anymore, can not answer calls, no audio on whatsapp, music player makes no sound. Everything fine after a reboot.
I was waiting for a few days before posting this to try to understand more about what is happening but can’t figure it out.
PRECONDITIONS:
STEPS TO REPRODUCE:
Just wait for a few hours. I didn’t understand what causes the issue but it’s been happening every day.
I read the posts in the 2022 bug report for version 4.4 from almost a year ago. It makes sense that the phone will be “out of RAM” after using a GPS app because those tend to allocate lots of RAM to cache as much as they can of the maps. That the “OOM killer” decides to kill Pulse Audio because there is no more free RAM is the worst thing that can happen on a phone. Even a reboot would be preferable.
Imagining that it is written in C, we must edit oom.cpp, wherever that is, and keep nasty “OOM killer” from ever killing Pulse Audio, recompile and submit a patch. I am an experienced C coder, I’m all in on switching to a Linux phone OS and I can find some spare time to contribute. Can anyone guide me on where to find the source code and compile tools?
From the OOM documentation, we just need to tweak the “badness()” function so that it never gives a bad score to Pulse Audio. Adding a list of “essential” processes that can never be killed, if that has not been done already.
" Process Selection
Whenever out of memory failure occurs, the out_of_memory() function will be called. Within it the select_bad_process() function is used which gets a score from the badness() function. The most ‘bad’ process is the one that will be sacrificed. There are some rules badness() function follows for the selection of the process."
No need to patch, compile or otherwise change anything in code, you can adjust oom kill likelyhood per-process using a sysctl tunable, or better let systemd do it for you.
Of you search some more you will find the issue is not that simple though, as there are several different memory pressure systems in place on SFOS, (the kernel oom, the mce one, the Android one at least) and finding the right tuning for all of them isn’t trivial.