Freezing during big compiles? Add a Swap file


#1

We have noticed that large projects requiring more than 1GB of RAM cause the build to freeze.

This issue can be fixed by creating a Swap file.

First time setting up the swapfile: sudo fallocate -l 1g /myswapfile (or slower: sudo dd if=/dev/zero of=/myswapfile bs=1g) sudo chmod 600 /myswapfile sudo mkswap /swapfile
Then, whenever you want to use the swapfile: sudo swapon /myswapfile
To verify the swapfile is being used: free -k # You should see a bottom line “Swap:” sudo swapon -s # You should see /myswapfile, size, and space used

#2

right… we noticed that too… it’s the kernel out of memory killer that will do ‘its job’…

we debated whether or not to include a swapfile by default in the ubuntu image, and we decided not to add it… not sure we want to reserve that space on the eMMC by default…

i am opened to suggestions…