If you are running out of VM, you should configure a bigger swap. Ram size just affects speed! Sometimes it is difficult to do this because it is a formatted partition (see disks). You can create a file and add it to the swap, and put the command to add it into a system startup file.