No swap inside containers when using snap LXD

Does this workaround actually work?

After enabling “swapaccount=1” via GRUB file and setting the above mentioned parameters I can now see 10GB swap inside my container, but it is never used.

I tried filling a tmpfs inside the container as well as letting processes run out of memory.
In both cases the RAM fills up until it is completely full and processes are being killed by the kernels OOM killer, all while swap stays at 0 bytes used.

Does anybody else experience this issue or has found a solution?
Thank you

1 Like