Just to document, I tried with this setup : Custom ZRAM Optimization (4 GB + Swappiness=20) with example for Xperia 10 III and tested on C2 too— Guide Available
But without any improvement.
Just to document, I tried with this setup : Custom ZRAM Optimization (4 GB + Swappiness=20) with example for Xperia 10 III and tested on C2 too— Guide Available
But without any improvement.
I’ve been the lucky one today : it started.
I used this luck to resync Whisperfish…
This morning my Xperia 10iii (SFOS 5.0.0.77) entered the Android restart loop as well. After several attempts, I managed to extract these logs:
05-05 08:08:43.223 310 338 W system_server: Throwing OutOfMemoryError "Failed to allocate a 104 byte allocation with 438952 free bytes and 428KB
until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC." (VmSize 17406728 kB)
05-05 08:08:43.223 310 338 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.bg
05-05 08:08:43.223 310 338 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 104 byte allocation with 438952 free bytes and 428
KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
So it’s the heap thing. Do we really not have a solution to this? This is terrible.
EDIT: This is a full log from a crash:
05-05 08:38:10.487 62 62 D AndroidRuntime: >>>>>> START com.android.internal.os.ZygoteInit uid 0 <<<<<<
05-05 08:38:10.794 61 61 D AndroidRuntime: >>>>>> START com.android.internal.os.ZygoteInit uid 0 <<<<<<
05-05 08:38:11.321 62 62 I AndroidRuntime: Using default boot image
05-05 08:38:11.321 62 62 I AndroidRuntime: Leaving lock profiling enabled
05-05 08:38:11.673 61 61 I AndroidRuntime: Using default boot image
05-05 08:38:11.673 61 61 I AndroidRuntime: Leaving lock profiling enabled
05-05 08:38:15.576 311 311 W system_server: Failed to upload odrefresh metrics: metrics file '/data/misc/odrefresh/odrefresh-metrics.txt' could not be opened: No such file or directory
05-05 08:38:15.576 311 311 E system_server: Not starting debugger since process cannot load the jdwp agent.
05-05 08:38:16.132 311 311 E system_server: Disallowing getting service: android.hardware.memtrack@1.0::IMemtrack
05-05 08:38:16.210 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.211 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.211 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.212 311 346 E system_server: Cannot read thread CPU times for PID 311
05-05 08:38:16.319 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.320 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.320 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.321 311 346 E system_server: Cannot read thread CPU times for PID 311
05-05 08:38:16.805 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.806 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.806 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.806 311 346 E system_server: Cannot read thread CPU times for PID 311
05-05 08:38:16.846 311 323 I system_server: Background concurrent copying GC freed 216187(10MB) AllocSpace objects, 109(4420KB) LOS objects, 45% free, 7508KB/13MB, paused 122us,59us total 110.974ms
05-05 08:38:16.859 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.860 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.861 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.861 311 346 E system_server: Cannot read thread CPU times for PID 311
05-05 08:38:16.863 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.863 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.864 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:16.864 311 346 E system_server: Cannot read thread CPU times for PID 311
05-05 08:38:16.944 311 311 I system_server: Created attach input device service listener
05-05 08:38:17.262 311 340 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
05-05 08:38:17.307 311 340 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
05-05 08:38:17.308 311 340 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
05-05 08:38:17.310 311 340 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
05-05 08:38:17.311 311 340 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
05-05 08:38:17.313 311 340 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
05-05 08:38:17.758 311 311 I system_server: Waiting for a blocking GC ClassLinker
05-05 08:38:17.789 311 311 I system_server: WaitForGcToComplete blocked ClassLinker on Background for 31.341ms
05-05 08:38:17.858 311 311 W ActivityManager: Too early to start/bind service in system_server: Phase=550 ComponentInfo{com.android.server.telecom/com.android.server.telecom.components.TelecomService}
05-05 08:38:17.859 311 311 W ActivityManager: Too early to start/bind service in system_server: Phase=550 ComponentInfo{com.android.server.telecom/com.android.server.telecom.components.TelecomService}
05-05 08:38:18.093 311 311 D ConnectivityModuleConnector: Starting networking module in system_server process
05-05 08:38:18.095 311 311 D ConnectivityModuleConnector: Starting networking module in system_server process
05-05 08:38:18.248 311 311 I system_server: Waiting for a blocking GC ClassLinker
05-05 08:38:18.297 311 311 I system_server: WaitForGcToComplete blocked ClassLinker on Background for 47.136ms
05-05 08:38:18.903 510 510 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
05-05 08:38:18.956 511 511 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
05-05 08:38:19.163 311 339 I system_server: Using smaps_rollup for pss collection
05-05 08:38:19.186 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:19.187 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:19.188 311 346 E system_server: Cannot obtain CPU frequency count
05-05 08:38:19.188 311 346 E system_server: Cannot read thread CPU times for PID 311
05-05 08:38:19.455 311 323 I system_server: Background concurrent copying GC freed 27579(3000KB) AllocSpace objects, 21(772KB) LOS objects, 17% free, 28MB/34MB, paused 427us,282us total 113.746ms
05-05 08:38:19.659 311 323 I system_server: Background concurrent copying GC freed 12388(4034KB) AllocSpace objects, 5(164KB) LOS objects, 11% free, 47MB/53MB, paused 218us,285us total 112.965ms
05-05 08:38:19.849 311 323 I system_server: Background concurrent copying GC freed 10566(2277KB) AllocSpace objects, 0(0B) LOS objects, 9% free, 56MB/62MB, paused 153us,107us total 103.346ms
05-05 08:38:20.040 311 323 I system_server: Background concurrent copying GC freed 2023(2742KB) AllocSpace objects, 0(0B) LOS objects, 7% free, 78MB/84MB, paused 189us,86us total 114.120ms
05-05 08:38:20.287 311 323 I system_server: Background concurrent copying GC freed 382(242KB) AllocSpace objects, 0(0B) LOS objects, 5% free, 108MB/114MB, paused 683us,85us total 159.513ms
05-05 08:38:20.573 311 323 I system_server: Background concurrent copying GC freed 413(3472KB) AllocSpace objects, 7(140KB) LOS objects, 4% free, 136MB/142MB, paused 128us,80us total 186.290ms
05-05 08:38:20.861 311 323 I system_server: Background concurrent copying GC freed 6085(5489KB) AllocSpace objects, 0(0B) LOS objects, 3% free, 157MB/163MB, paused 734us,405us total 222.818ms
05-05 08:38:21.323 311 323 I system_server: Background concurrent copying GC freed 31115(1976KB) AllocSpace objects, 14(728KB) LOS objects, 3% free, 185MB/191MB, paused 143us,77us total 365.490ms
05-05 08:38:21.453 311 332 I system_server: Waiting for a blocking GC Explicit
05-05 08:38:21.532 311 323 I system_server: Background young concurrent copying GC freed 26065(4004KB) AllocSpace objects, 10(536KB) LOS objects, 0% free, 200MB/200MB, paused 119us,93us total 166.428ms
05-05 08:38:21.532 311 332 I system_server: Waiting for a blocking GC Explicit
05-05 08:38:21.905 311 323 I system_server: Background concurrent copying GC freed 1367(2696KB) AllocSpace objects, 0(0B) LOS objects, 2% free, 239MB/245MB, paused 121us,85us total 373.477ms
05-05 08:38:21.906 311 332 I system_server: WaitForGcToComplete blocked Explicit on Background for 452.536ms
05-05 08:38:22.019 311 339 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.400 311 364 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.434 311 389 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.461 311 580 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.546 311 332 I system_server: Explicit concurrent copying GC freed 27506(3984KB) AllocSpace objects, 0(0B) LOS objects, 2% free, 246MB/252MB, paused 259us,57us total 639.899ms
05-05 08:38:22.546 311 323 I system_server: WaitForGcToComplete blocked Background on Explicit for 578.536ms
05-05 08:38:22.546 311 339 I system_server: WaitForGcToComplete blocked Alloc on Explicit for 527.519ms
05-05 08:38:22.546 311 339 I system_server: Starting a blocking GC Alloc
05-05 08:38:22.546 311 364 I system_server: WaitForGcToComplete blocked Alloc on Explicit for 146.084ms
05-05 08:38:22.546 311 364 I system_server: Starting a blocking GC Alloc
05-05 08:38:22.547 311 389 I system_server: WaitForGcToComplete blocked Alloc on Explicit for 112.612ms
05-05 08:38:22.547 311 389 I system_server: Starting a blocking GC Alloc
05-05 08:38:22.547 311 580 I system_server: WaitForGcToComplete blocked Alloc on Explicit for 86.464ms
05-05 08:38:22.547 311 580 I system_server: Starting a blocking GC Alloc
05-05 08:38:22.601 311 339 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.622 311 311 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.641 311 507 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.667 311 339 I system_server: WaitForGcToComplete blocked Alloc on Background for 66.082ms
05-05 08:38:22.667 311 339 I system_server: Starting a blocking GC Alloc
05-05 08:38:22.668 311 311 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.669 311 507 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.747 311 339 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.749 311 423 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.749 311 348 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:22.875 311 340 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:23.053 311 323 I system_server: Clamp target GC heap from 257MB to 256MB
05-05 08:38:23.054 311 323 I system_server: Background concurrent copying GC freed 2249(3691KB) AllocSpace objects, 0(0B) LOS objects, 1% free, 251MB/256MB, paused 143us,59us total 385.511ms
05-05 08:38:23.054 311 311 I system_server: WaitForGcToComplete blocked Alloc on Background for 432.144ms
05-05 08:38:23.054 311 311 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.055 311 507 I system_server: WaitForGcToComplete blocked Alloc on Background for 413.717ms
05-05 08:38:23.055 311 507 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.055 311 339 I system_server: WaitForGcToComplete blocked Alloc on Background for 307.643ms
05-05 08:38:23.055 311 339 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.055 311 423 I system_server: WaitForGcToComplete blocked Alloc on Background for 306.575ms
05-05 08:38:23.055 311 423 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.057 311 348 I system_server: WaitForGcToComplete blocked Alloc on Background for 307.368ms
05-05 08:38:23.057 311 348 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.057 311 340 I system_server: WaitForGcToComplete blocked Alloc on Background for 182.254ms
05-05 08:38:23.057 311 340 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.094 311 959 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.094 311 959 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.095 311 339 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:23.128 311 580 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:23.141 311 959 I system_server: Alloc young concurrent copying GC freed 3110(295KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 269us,66us total 46.794ms
05-05 08:38:23.141 311 959 I system_server: Forcing collection of SoftReferences for 24B allocation
05-05 08:38:23.141 311 959 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.141 311 339 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:23.141 311 580 I system_server: Waiting for a blocking GC Alloc
05-05 08:38:23.730 311 959 I system_server: Clamp target GC heap from 260MB to 256MB
05-05 08:38:23.730 311 959 I system_server: Alloc concurrent copying GC freed 1098(69KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 106us,62us total 589.197ms
05-05 08:38:23.731 311 959 W system_server: Throwing OutOfMemoryError "Failed to allocate a 24 byte allocation with 1555648 free bytes and 1519KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC." (VmSize 17123192 kB)
05-05 08:38:23.731 311 339 I system_server: WaitForGcToComplete blocked Alloc on Alloc for 635.701ms
05-05 08:38:23.731 311 339 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.731 311 580 I system_server: WaitForGcToComplete blocked Alloc on Alloc for 603.141ms
05-05 08:38:23.731 311 580 I system_server: Starting a blocking GC Alloc
05-05 08:38:23.731 311 959 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: NetworkMonitor/100
05-05 08:38:23.731 311 959 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 1555648 free bytes and 1519KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
05-05 08:38:23.731 311 959 E AndroidRuntime: at com.android.server.connectivity.NetworkMonitor$DnsStallDetector.accumulateConsecutiveDnsTimeoutCount(NetworkMonitor.java:3347)
05-05 08:38:23.731 311 959 E AndroidRuntime: at com.android.server.connectivity.NetworkMonitor$ValidatedState.processMessage(NetworkMonitor.java:1161)
05-05 08:38:23.731 311 959 E AndroidRuntime: at android.net.networkstack.util.StateMachine$SmHandler.processMsg(StateMachine.java:993)
05-05 08:38:23.731 311 959 E AndroidRuntime: at android.net.networkstack.util.StateMachine$SmHandler.handleMessage(StateMachine.java:810)
05-05 08:38:23.731 311 959 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
05-05 08:38:23.731 311 959 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
05-05 08:38:23.731 311 959 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
05-05 08:38:23.731 311 959 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
05-05 08:38:23.732 311 959 I DropBoxManagerService: add tag=system_server_crash isTagEnabled=true flags=0x2
05-05 08:38:23.929 61 61 E Zygote : Zygote failed to write to system_server FD: Connection refused
05-05 08:38:24.044 1006 1032 E AndroidRuntime: FATAL EXCEPTION: High Pri Worker #1
05-05 08:38:24.044 1006 1032 E AndroidRuntime: Process: com.whatsapp, PID: 1006
05-05 08:38:24.044 1006 1032 E AndroidRuntime: DeadSystemException: The system died; earlier logs will point to the root cause
05-05 08:38:25.164 549 549 D AndroidRuntime: Shutting down VM
05-05 08:38:25.165 549 549 E AndroidRuntime: FATAL EXCEPTION: main
05-05 08:38:25.165 549 549 E AndroidRuntime: Process: com.android.phone, PID: 549
05-05 08:38:25.165 549 549 E AndroidRuntime: DeadSystemException: The system died; earlier logs will point to the root cause
It seems I found a solution that has worked for me (for now?)
First I recorded several logcat logs:
defaultuser in 🌐 Xperia10III in ~ as 🧙
🐟 ❯ while true;sudo appsupport-attach /system/bin/logcat | grep -E 'system_server|AndroidRuntime' | tee ~/$(date +%Y%m%d%H%M%S%z-logcat.log);find -maxdepth 1 -iname '*-logcat.log' -empty -delete;sleep 1;end
<lots of output>
defaultuser in 🌐 Xperia10III in ~ as 🧙
🐟 ❯ ls
20260505103008+0200-logcat.log 20260505104152+0200-logcat.log 20260505104611+0200-logcat.log 20260505105015+0200-logcat.log ************* Pictures/
20260505103714+0200-logcat.log 20260505104223+0200-logcat.log 20260505104641+0200-logcat.log 20260505105045+0200-logcat.log android_storage/ Playlists/
20260505103745+0200-logcat.log 20260505104254+0200-logcat.log 20260505104712+0200-logcat.log 20260505105120+0200-logcat.log *********** Public/
20260505103808+0200-logcat.log 20260505104338+0200-logcat.log 20260505104745+0200-logcat.log 20260505105153+0200-logcat.log Desktop/ Templates/
20260505103837+0200-logcat.log 20260505104409+0200-logcat.log 20260505104815+0200-logcat.log 20260505105225+0200-logcat.log Documents/ Videos/
20260505104012+0200-logcat.log 20260505104441+0200-logcat.log 20260505104845+0200-logcat.log 20260505105258+0200-logcat.log Downloads/ ******
20260505104045+0200-logcat.log 20260505104511+0200-logcat.log 20260505104915+0200-logcat.log 20260505105329+0200-logcat.log **************
20260505104118+0200-logcat.log 20260505104541+0200-logcat.log 20260505104944+0200-logcat.log 20260505105451+0200-logcat.log Music/
I then grepped for the OutOfMemoryError:
🐟 ❯ grep -A30 'OutOfMemory' *-logcat.log | grep 'OutOfMemory\|\bat\b'
And this UsageStats thing kept popping up:
...
0260505104338+0200-logcat.log:05-05 10:43:55.744 315 341 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 104 byte allocation with 172
5536 free bytes and 1685KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsProtoV2.parseEvent(UsageStatsPr
otoV2.java:237)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsProtoV2.read(UsageStatsProtoV2.
java:498)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsDatabase.readLocked(UsageStatsD
atabase.java:1148)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsDatabase.readLocked(UsageStatsD
atabase.java:1102)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsDatabase.readLocked(UsageStatsD
atabase.java:1085)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsDatabase.getLatestUsageStats(Us
ageStatsDatabase.java:747)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UserUsageStatsService.loadActiveStats(Use
rUsageStatsService.java:898)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UserUsageStatsService.rolloverStats(UserU
sageStatsService.java:849)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UserUsageStatsService.reportEvent(UserUsa
geStatsService.java:316)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsService.reportEvent(UsageStatsS
ervice.java:1168)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsService.onUserUnlocked(UsageSta
tsService.java:460)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsService.-$$Nest$monUserUnlocked
(Unknown Source:0)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at com.android.server.usage.UsageStatsService$H.handleMessage(UsageSt
atsService.java:1927)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
20260505104338+0200-logcat.log-05-05 10:43:55.744 315 341 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
...
So I searched for files or folders named usagestats:
🐟 ❯ sudo find /home -type d -name "usagestats" 2>/dev/null
/home/.appsupport/instance/defaultuser/data/system_ce/0/usagestats
As nothing was working anyway, I thought I’d just move that directory out of the way, while stopping the appsupport completely:
🐟 ❯ sudo systemctl stop appsupport@defaultuser.service
🐟 ❯ sudo mv /home/.appsupport/instance/defaultuser/data/system_ce/0/usagestats{,.bak}
🐟 ❯ sudo systemctl restart appsupport@defaultuser.service
After that, I can use Android apps as usual, no crashes. ![]()
Nice! My AAS is currently booting normally, but I will definitely check this out if it doesn’t start again. It won’t still be a real solution but at least a workaround.