Disable zRAM on boot and use a swapfile instead.
This Magisk "module" (actually just a couple of shell commands to run on boot) is not generalized; i.e. It Works On My Machine. Please do not flash without understanding what those commands do and/or making modifications if necessary first.
mkswap
cat /proc/meminfo | grep ^Swap
cat /proc/swaps
- RAM Truth (not affiliated; it's just a neat app that I've found)
-
Q: Why?
A: I'm poor. -
Q: Swap priority?
A: Don't bother unless you want to use multiple swaps. -
Q: Why
post-fs-data.sh
and notservice.sh
?
A: Because it's taking significantly longer for me to disable zRAM once Zygote is up. I haven't bothered to find out why. -
Q: Any way to try this without installing?
A: ADB hint: you canstop
, do your thing, thenstart
again. This will soft-reboot the device. -
Q: This "module" sucks and I want something better.
A: Not a question, but see Swap Torpedo by EarlyMon @ XDA or zRAM Swap Manager by VR-25 @ GitHub for a start. -
Q: Why is this README longer than the code itself?
A: I can't see why not.