Waydroid under memory pressure

Waydroid works fine when there is enough free RAM. But if RAM is already filled by other programs to the point that ZRAM is heavily used, Android starts frequently killing foreground apps. It is amusing to see how with each try to start a particular app in Waydroid it pushes more and more of other stuff into ZRAM and thus survives each time a bit longer.

Is there anything which can be tweaked to prevent Android from killing a foreground app on low RAM?

I faced this problem when I moved some of my frequently used apps out of Waydroid. It is unfortunate that desktop versions of many apps unexpectedly require ≥400MB RAM, most of which is eventually stuffed into ZRAM. This is probably a sign that corresponding memory regions are mostly unused and are a dead weight.

1 Like

Swap filling too?

free -m

It is Librem 5, so no real swap. I experimented once with swap on MicroSD, but results were worse than just bad.

UPD:

Before starting Waydroid:

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            2900        2505          47         440         789         394
Swap:           5799        1998        3801

After starting Waydroid and trying to run an app:

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            2900        2317          56         472        1090         583
Swap:           5799        2661        3138