Hi Everyone..
So I hope this is a bug and not a feature..
Xiaomi Redmi Note 9 Pro (joyeuse) && Android 12 && MIUI 13
xiaomi.eu_multi_HMNote9ProEU_V13.0.2.0.SJZMIXM_v13-12-fastboot
This issue is persistent since ages, really. I can't really tell when I figured this out (like 2 years ago) but the thing is:
There's a kind of service running in the Xiaomi.EU ROMs of Joyeuse called "PeriodicCleaner".
As you can see it is killing processes.. the problem with this is that these are actually locked apps, battery optimization of MIUI is set to "no restriction" to ALL of them and even Autostart, etc. is enabled as well. As you can see it is killing Facebook Messenger at night even though it is running with ADJ 400(!!!), Pinnit with ADJ 250(!!! this app actually has a permanent notification just to keep itself alive!), Life360 running with ADJ 400, etc. The above sandboxed chromium processes are all opened webpage tabs in a browser I'm using. This is not okay.
This is how the help looks like of the service:
This is how a sample stat of the service looks like:
It is part of the ActivityManager of the ROM, started by the system_server (not an AOSP code for sure):
It can be disabled with the below ADB command temporarily (until you reboot..):
or with root -if you have- you can disable it permanently with:
But obviously starts at each and every reboot again so I have to disable it after every reboot (I'm using termux && web adb) to get rid of it. I know how to disable it with root quasi permanently (setting "persist.sys.periodic.enable" to "false" with a small script using Magisk's "resetprop" or using MHPC.. or simply set it with setprop persist.sys.periodic.enable false and you won't need to set it anymore because it remains in the system) but this is going for like 2 years or so.. my problem is: even though you can technically disable it you can't disable it permanently without root.. and the adb way is a bit clunky for normal users. But the benefit of disabling it is huge if you ask me, saves you from A LOT of headaches..
How can one completely disable it without root? Why it's included anyways?
May I ask you to simply remove it from the ROM builds, please?
The other thing is: Camera boost.. does the same thing.. killing processes.. why on earth MIUI is killing my lightweight browser and other, small footprint apps (like Pinnit) when I simply start the camera? Why it is actually killing anything? If the memory pressure is high just go ahead, I understand.. but when I have 2 apps in my recent list and simply starting the camera.. even the launcher says there's 2.9GB of RAM free.. I know how the android memory management is working (and thus I know that 2.9GB "free" is fake..) but hey, this behavior is not acceptable.
Thank you if you can look into or guide me regarding this.
____
crok
So I hope this is a bug and not a feature..
Xiaomi Redmi Note 9 Pro (joyeuse) && Android 12 && MIUI 13
xiaomi.eu_multi_HMNote9ProEU_V13.0.2.0.SJZMIXM_v13-12-fastboot
This issue is persistent since ages, really. I can't really tell when I figured this out (like 2 years ago) but the thing is:
There's a kind of service running in the Xiaomi.EU ROMs of Joyeuse called "PeriodicCleaner".
Code:
Date Time PID TID APP TAG Text
09-11 01:27:56.824 1000 2075 2123 I ProcessManager: Kill reason PeriodicCleaner(4|2|pressure) from pid=2075
09-11 01:27:56.849 1000 2075 2123 I ProcessManager: PeriodicCleaner(4|2|pressure): kill com.facebook.orca Adj=400 State=10
09-11 01:27:56.850 1000 2075 2123 I ActivityManager: Killing 7223:com.facebook.orca/u0a275 (adj 400): PeriodicCleaner(4|2|pressure)
09-11 01:27:56.861 1000 2075 2123 I ProcessManager: PeriodicCleaner(4|2|pressure): kill com.facebook.orca:fwkstartlog Adj=935 State=19
09-11 01:27:56.861 1000 2075 2123 I ActivityManager: Killing 8249:com.facebook.orca:fwkstartlog/u0a275 (adj 935): PeriodicCleaner(4|2|pressure)
09-11 01:27:56.866 1000 2075 2123 I ProcessManager: PeriodicCleaner(4|2|pressure): kill dev.sasikanth.pinnit Adj=250 State=5
09-11 01:27:56.866 1000 2075 2123 I ActivityManager: Killing 5329:dev.sasikanth.pinnit/u0a240 (adj 250): PeriodicCleaner(4|2|pressure)
09-11 01:27:56.870 1000 2075 2123 I ProcessManager: PeriodicCleaner(4|2|pressure): kill com.life360.android.safetymapd Adj=400 State=10
09-11 01:27:56.870 1000 2075 2123 I ActivityManager: Killing 6709:com.life360.android.safetymapd/u0a542 (adj 400): PeriodicCleaner(4|2|pressure)
09-11 01:27:56.876 1000 2075 2123 I ProcessManager: PeriodicCleaner(4|2|pressure): kill com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0 Adj=905 State=10
09-11 01:27:56.877 1000 2075 2123 I ActivityManager: Killing 9589:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a542i2 (adj 905): PeriodicCleaner(4|2|pressure)
09-11 01:27:56.879 1000 2075 2123 I ProcessManager: PeriodicCleaner(4|2|pressure): kill com.life360.android.safetymapd:service Adj=500 State=10
As you can see it is killing processes.. the problem with this is that these are actually locked apps, battery optimization of MIUI is set to "no restriction" to ALL of them and even Autostart, etc. is enabled as well. As you can see it is killing Facebook Messenger at night even though it is running with ADJ 400(!!!), Pinnit with ADJ 250(!!! this app actually has a permanent notification just to keep itself alive!), Life360 running with ADJ 400, etc. The above sandboxed chromium processes are all opened webpage tabs in a browser I'm using. This is not okay.
This is how the help looks like of the service:
Code:
joyeuse:/ $ cmd periodic
Periodic Cleaner commands:
help
Print this help text.
dump
Print fg-lru and clean history.
clean [-r REASON]
Trigger clean action.
-r: select clean reason
REASON is one of:
periodic
pressure-low
pressure-min
pressure-critical
pressure-low time
pressure-min time
pressure-critical time
default reason is periodic if no REASON
enable [true|false]
Enable/Disable peridic cleaner.
debug [true|false]
Enable/Disable debug config.
updatelist
Update highfrequencyapp and highmemoryapp list.
This is how a sample stat of the service looks like:
Code:
joyeuse:/ $ cmd periodic dump
---- Foreground-LRU ----
Settings:
Enable=true Ready=true FgTrim=false Debug=false mOverTimeAppNum=4 LruLengthLimit=8
AvailableLow=1450000Kb AvailableMin=1370000Kb AvailableCritical=1290000Kb
Package Usage LRU:
CurLength:9 CurrentPressure:low
u0/10275:com.termux:(non-trimed):1970-01-01 01:00:00
u0/10246:com.dp.logcatapp:(non-trimed):2023-01-07 16:43:53
u0/10279:com.mycompany.app.soulbrowser:(non-trimed):2023-01-07 16:43:36
u0/10287:eu.faircode.email:(non-trimed):2023-01-07 16:42:50
u0/10272:com.facebook.orca:(non-trimed):2023-01-07 16:15:33
u0/10239:com.beemdevelopment.aegis:(non-trimed):2023-01-07 16:13:40
u0/10153:com.google.android.gms:(non-trimed):2023-01-07 16:12:25
u0/10317:com.life360.android.safetymapd:(non-trimed):2023-01-07 15:46:43
u0/10232:com.google.android.webview.dev:(non-trimed):2023-01-07 15:39:46
High Memory Usage List:
High Frequency Usage List:
---- End of Foreground-LRU ----
---- CleanHistory ----
#0 16:43:53.609 critical 4 pressure {0=[com.facebook.orca]}
#1 16:42:50.048 critical 4 pressure {0=[com.life360.android.safetymapd]}
#2 16:13:40.721 critical 4 pressure {0=[com.facebook.orca]}
#3 16:13:23.572 critical 4 pressure {0=[com.facebook.orca]}
#4 16:12:20.762 critical 4 pressure {0=[com.life360.android.safetymapd]}
---- End of CleanHistory ----
It is part of the ActivityManager of the ROM, started by the system_server (not an AOSP code for sure):
Code:
com.android.server.am.PeriodicCleanerService
Code:
DUMP OF SERVICE system_server_dumper:
SystemServer:
Runtime restart: false
Start count: 1
Runtime start-up time: +17s960ms
Runtime start-elapsed time: +17s960ms
SystemServiceManager:
Current phase: 1000
Current user not set!
1 target users: 0(full)
137 started services:
[..omitted..]
com.android.server.am.PeriodicCleanerService
It can be disabled with the below ADB command temporarily (until you reboot..):
Code:
adb shell cmd periodic enable false
or with root -if you have- you can disable it permanently with:
Code:
su
setprop persist.sys.periodic.enable false
But obviously starts at each and every reboot again so I have to disable it after every reboot (I'm using termux && web adb) to get rid of it. I know how to disable it with root quasi permanently (setting "persist.sys.periodic.enable" to "false" with a small script using Magisk's "resetprop" or using MHPC.. or simply set it with setprop persist.sys.periodic.enable false and you won't need to set it anymore because it remains in the system) but this is going for like 2 years or so.. my problem is: even though you can technically disable it you can't disable it permanently without root.. and the adb way is a bit clunky for normal users. But the benefit of disabling it is huge if you ask me, saves you from A LOT of headaches..
How can one completely disable it without root? Why it's included anyways?
May I ask you to simply remove it from the ROM builds, please?
The other thing is: Camera boost.. does the same thing.. killing processes.. why on earth MIUI is killing my lightweight browser and other, small footprint apps (like Pinnit) when I simply start the camera? Why it is actually killing anything? If the memory pressure is high just go ahead, I understand.. but when I have 2 apps in my recent list and simply starting the camera.. even the launcher says there's 2.9GB of RAM free.. I know how the android memory management is working (and thus I know that 2.9GB "free" is fake..) but hey, this behavior is not acceptable.
Thank you if you can look into or guide me regarding this.
____
crok
Last edited: