Basta adicionar esta linha ao seu arquivo vagante
Vagrantfile
# Enable Dynamic Swap Space to prevent Out of Memory crashes
config.vm.provision "shell", inline: "sudo apt install swapspace -y"
E, em seguida, reprovisionar
vagrant up --provision
Como funciona
Este é um daemon de espaço de troca dinâmico. Existem vários, mas aqui é um popular.
sudo apt install swapspace
Para verificar se está sendo executado
sudo service swapspace status
Trecho do link
This system daemon for the Linux kernel aims to do away with the need
for large, fixed swap partitions or swap files.
When installing a Linux-based system (invariably GNU/Linux) with
Swapspace, the usual swap partition can be omitted, or it can be kept
quite small. Whenever Swapspace finds during normal system usage that
more virtual memory is needed, it will automatically claim space from
the hard disk. Conversely, swap space that is no longer needed is
freed up again for regular use by the filesystem.
This means that with Swapspace installed, sizing the system's
available swap space during installation is no longer a life-or-death
choice. It now becomes practical to run GNU/Linux off just a single,
big partition--with no disk space lost to regrettable installation
choices. The system should also be able to handle the occasional
memory-intensive task that takes much more swap space than was
originally foreseen, without leaving the same swap space unused and
unusable during normal operation as is normally the case.