I am getting Out of Memory errors while my swap isn't touched. I have 4GB of ram and 4GB of swap space. I enabled the swap via swapon and when doing free, I see the swap listed there.
I'm thinking that perhaps there is some issue with overlayfs / tmpfs and swap all working together. I have always had the opposite problem, trying to prevent swap usage, so I can't seem to figure out what changed.
Also, I am using a grsecurity enabled kernel. Is it possible that memory allocation work differently under there?
Snapshot of free:
total used free shared buff/cache available Mem: 3586392 157292 67052 141664 3362048 3236524 Swap: 4194300 0 4194300
After I added the swap configuration to /etc/fstab, these numbers have changed; however, I still don't see any swap usage. The only other thing I changed was the tmpfs size for /dev/shm and my overlayfs volume (/rw). Both of which were not using much space to begin with, so the change should not have had any impact.
total used free shared buff/cache available Mem: 3586392 571392 1714036 146096 1300964 2818004 Swap: 4194300 0 4194300
I restarted a bunch of services and they're still running, and the biggest difference I see is that free memory is now showing 1.7GB free versus 67MB prior.
I'm still confused as to why that had any impact. If I enable swap through swapon, it should behave the same way as if I configure it through /etc/fstab and do swapon -a. Furthermore, it isn't even being used yet anyways.