I’m using a MacBook Air M1 8 GB. I noticed that there’s only 7.3 GB of swap, and I often run out of memory even just by watching YouTube. The system would freeze immediately, requiring a reboot by long pressing the power button to get it going again.
This is what the swap partition looks like:
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 7.3G 115M 100
Is there a way to grow the size of swap partition?
If you’re running out of memory then increasing the swap size would make the issue worse. You are likely being hit with an oom condition that causes the freeze. I would switch to swap on disk at least to see if that helps.