When installing windows on vmware player virtual machine at my Arch Linux host something strange happened. First the host computer would slow down considerably and practically freeze. Afterwards over time the player suddenly crashes without a reason.
After digging around logs I found the following:
kernel: Out of memory: Kill process 4168 (vmware-vmx) score 469 or sacrifice child kernel: Killed process 4168 (vmware-vmx) total-vm:11135180kB, anon-rss:32704kB, file-rss:7571312kB, shmem-rss:71436kB
So what happened was that the kernel seened to think that vmware was taking too much memory and in order to avoid whole system crash, killed the vmware process. At this point it should be noted that the quest operating system had 8GB of memory out of 16 so running out of memory was not the problem.
The solution that allowed the installation process complete smoothly to finish is a little bizarre to someone who doesn’t understand low-level stuff (among who I count myself). I’m sure there is an engineer out there who can say why this is but the solutions turns out to be adding a swapfile.
Swapfiles are essentailly hard disk space allocated to store some excess memory from RAM. This is to avoid all of RAM being used. As I understand it, RAM that is not actively used or is otherwise stagnant is allocated to swap until it is needed again. This is mostly relevant on systems with 2g or less actual RAM memory and since I have 16, I didn’t think I needed seperate swap. Also constant writing to swapfile tends to decrease the life of ssd drives.
So now that we know what solves the problem, how do we solve it? Few simple commands will suffice.
First we allocate some space for our swap.
fallocate -l 8196M tempswap chmod 600 tempswap sudo chown root tempswap sudo swapon tempswap
By the waym while monitoring my system with htop during installation I found that the amount of swap used was 152K 😀