System: Rooted Android 4.4 phone (actual rom: CM 11 Milestone 6) with 1GB ram, plenty of internal storage, but no sdcard slot. My phone's partition scheme is unmodified CyanogenMod 11.
Problem: lowmemorykiller/OOM handler on my phone keeps killing vital system processes such as the lockscreen, or incallui, or acore, causing at best long freezes, and more often soft and hard system lockups. I'm probably running apps that push RAM beyond system minimum, and it's making a suboptimal choice of background process to kill. I looked into fine-tuning lowmemkiller but got nowhere.
As ram and not CPU is the issue, I want to try enabling internal storage based swap instead of zRAM as a workaround, which the phone should handle. But I can't find clear instructions how to do so. Every instructional page I found is either desktop not Android specific, external (SDcard) storage specific ("partition using USB+windows"), assumes you want file not partition based swap, or suggests a Google Play app to use. None explain step by step how to actually do it.
Assuming I've read the warnings and know the risks, and want to go ahead anyway, how do I do it? I really just want to get a list of the example console commands for using partition-based swap. I assume it goes something like this:
- Resize existing partition(s) or subpartition(s) to create spare space for a dedicated fixed-size swap partition.
- Create or define a new partition in the free space, and ensure it's formatted as swap, or the OS will format or use it as swap on boot.
- Edit some other system files to ensure swap will be mounted and enabled appropriately on boot, so the OS can recognise and use it. (fstab, or something else?)
- Disable or deprioritise zRAM, and edit swappiness to about 20-30.
- Reboot, cross fingers, and hope I did it right.
My current *nix experience level: I know Linux uses partitions and subpartitions, that new partitions and partition changes probably need me to manually edit fstab or other files, and manual edits may also be needed to ensure partitions will be mounted/enabled/used at boot. I'm haven't used the actual commands or changed the actual files so I don't know what to expect. I'm comfortable with console, but this is a bit of a new area for me.
How do I do this, step by step, and what are the commands I'd use if they aren't obvious. I can figure the rest from that.