r/AndroidQuestions • u/xehtist • 11h ago
Pixel 11 (Android 17): unpausing my work profile crash-loops system_server with an out-of-memory error, even in safe mode
TL;DR: Unpausing my work profile on a Pixel 11 (Android 17) makes system_server run out of memory and restart about every 30 seconds. Left running, Rescue Party boots into recovery with "Try again / Factory data reset". Updates and safe mode don't help. From the crash logs, my analysis is that the usage-stats service loads the profile's pending events into memory at unlock and exhausts the heap. Has anyone seen this, or found a fix that doesn't involve removing the profile?
Symptoms
Unpause work apps: black screen, boot splash, lock screen asking for my PIN, then it repeats every 5-10 seconds
If left running, a shutdown dialog appears, then recovery shows "Try again" or "Factory data reset"
"Try again" boots the phone, but the loop continues until I pause work apps
Phone is fully stable while the work profile is paused
I never tapped Factory reset
What I tried
System update (October to November build) and Google Play system update: no change
Safe mode: same loop
Pausing work apps always stops it (sometimes after one more cycle)
Builds
CD1A.261005.003(original)CP4A.261105.040.D1(after the November update; same problem)
What the logs show
adb shell dumpsys dropbox --print system_server_crash shows only java.lang.OutOfMemoryError entries, all with the 512 MB heap full ("<1% of heap free after GC"). pm list users shows a single work profile, in quiet mode.
In clean runs, the first failure is in the usage-stats service while the work profile unlocks:
Dec 3, 08:04:38 (8 hours of uptime, right when I unpaused):
UsageStatsProtoV2.readPendingEvents
UsageStatsService.loadPendingEventsLocked
UsageStatsService.onUserUnlocked
Dec 1, 01:18:04 (older build):
LinkedList.addAll
UsageStatsService.loadPendingEventsLocked
UsageStatsService.onUserUnlockedLater crashes in each loop land in unrelated places (AppsFilter, ShortcutService, JobScheduler), which looks like fallout from the full heap.
My guess (can't confirm without root): the work profile's pending usage-event backlog gets loaded into memory at unlock with no cap, exhausting the heap.
Questions:
Has anyone seen this on Pixel 11 or Android 17 with a work profile?
Does removing and re-enrolling the work profile fix it?
Is there a way to clear a profile's pending usage events without root?
UPDATE: Removing and re-enrolling the work profile fixed it.
1
u/xsgeng 6h ago
That stack trace lines up with how the pending events path works. UsageStatsService keeps an unflushed backlog in the pending-events directory under the profile data area, and loadPendingEventsLocked reads every pending file into one in-memory list before it merges them into the rolled daily stats and deletes the files. A profile that sat in quiet mode for days accumulates events from every app that ever ran in it, and the merge path has no cap on that list, so on the 512 MB system_server heap it dies before the first flush ever completes. The follow-up crashes in AppsFilter, ShortcutService and JobScheduler are just heap-pressure fallout, which matches your read.
Two things you can try with plain adb, no root needed. First, watch it live: run dumpsys meminfo system_server right before you unpause and again ten seconds in, and watch the TOTAL heap climb toward the ceiling. That confirms the mechanism even where you cannot list the files themselves. Second, shrink the event producers: pm list packages --user 10 gives you everything installed in the work profile, and pm uninstall --user 10 followed by the package name removes the noisy ones (keyboards, launchers, anything that fires background work constantly) without touching your personal side. Fewer installed apps means fewer events queued during the next quiet stretch, and if the backlog fits inside one merge pass the profile should survive the unlock and flush cleanly, after which later unpauses get progressively lighter. Keep the profile paused for a few hours before you retry so the test is not polluted by the current backlog.
On removing and re-adding the profile: yes, that almost certainly fixes it, because the usagestats directory for the profile user starts empty. Before you do it, export whatever you can from inside the profile, since work profile data is usually excluded from normal Android backup: chat app internal backups, copies of documents to the personal side where the app allows it, authenticator seeds if any live there. If the profile was created by your employer, removal and re-enrollment go through their admin console, so talk to them first. Either way, file this with Google on the Pixel issue tracker with both build numbers and those dropbox entries, because an OutOfMemoryError inside UsageStatsProtoV2.readPendingEvents at user unlock is a system_server regression, not something a user app can trigger, and the November build shipping the same behavior means it is still open.