Most Android devices do not have a swap
area like typical operating systems do. Instead, Android manages memory differently, using techniques such as zRAM and low-memory killers to manage memory allocation among processes
Having said that, swap
may be created by magisk
or related modules. To see if it's there:
# cat /proc/swaps
Filename Type Size Used Priority
/dev/block/vnswap0 partition 2097148 1472552 -1
swapoff <block device path>
swapoff /dev/block/vnswap0
It will most likely give you a resource busy error. Have to run it at boot-time.
Useful references: Stack Overflow - Swapon failed trying to enable zram.
swapoff
cannot be run without root (CAP_SYS_ADMIN
to be more precise).