Conversation

I have a WearOS watch which is a frustratingly janky piece of crap. Whenever you try to do anything on it, it freezes for several seconds. Why? because it's SWAPPING! what the what?! 1.9G of virtual memory for a daemon on a wristwatch? 21 java apps, each with >760M vmem? JFC
Image
6
35
Replying to and
FFS why would you even have swap on a realtime mobile device???!? AIUI the OS is already designed to kill and restart junk that uses too much memory, so just let it do its thing...
2
3
If there's actually real swap, that's insane. Android isn't designed to work with swap. It's supposed to run out of memory and trigger the userspace OOM killer implementation to kill inactive apps. It gets apps to save snapshots of state as soon as they become inactive.
1
Replying to and
You'd need to check to figure out how the device is set up. Android devices do usually have a fair bit of zram. It has to be properly tuned for the device. It seems like this device may have way too much zram, and perhaps has it configured quite badly, especially for a weak CPU.
1
1
For example, here's the configuration for the Pixel 4: android.googlesource.com/device/google/ It has 6GB of memory and sets 2GB as the max zram size. It uses a backing file for zram writeback (512M) but that's *extremely* conservative and it has a fast SSD for it: android.googlesource.com/device/google/
1
2
On Pixels, the zram writeback job is done every 24 hours, meaning that it only actually flushes pages to storage (which is a fast SSD anyway) once per day that have been idle since the previous check a whole day earlier. First 2 runs after boot happen quicker (60 then 180 min).
1