This is a cache of https://discuss.96boards.org/t/freezing-during-big-compiles-add-a-swap-file/75. It is a snapshot of the page at 2024-11-01T02:34:38.642+0000.
Freezing during big compiles? Add a Swap file - DragonBoard410c - 96Boards Forum

Freezing during big compiles? Add a Swap file

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

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…