32MB swap is far too small - system runs out of memory often
The Pinephone only has 2GiB of RAM, of which 1.88GB can be addressed. For an aarch64 system, this isn't really that much. When the system is booted and only Lomiri is running, around 900MB is already consumed, mainly by the unity8
and ubuntu-push-client
processes.
So half of the RAM is easily used by the system, leaving only around 900MB for applications. When multitasking a bit (Dekko, TELEports, Morph with some tabs open), the system can run out of RAM quite easily. Just opening a large image in Morph can cause the system to lock up for minutes while it tries to swap pages out desperately, but it has no place to put them.
Sometimes the OOM killer is invoked and the system recovers, but usually it even needs a hard reboot, which I hate doing.
I have been able to immensely improve the system's performance by increasing the swapfile to 1GB like this:
cd /userdata/
sudo swapoff -a
sudo fallocate -l 1G SWAP.img
sudo mkswap SWAP.img
sudo swapon SWAP.img
Yes, this may indeed increase the eMMC degradation slightly, but the phone is near-unusable otherwise. I think the tradeoff is worth it, because the phone now no longer locks up anytime I open a 5MB image or something like that.