Installed Ubuntu 15.04 on my low-key laptop and fire a build for llvm project. After a while ubuntu popped up internal error message. When I checked System Monitor- I ran out of RAM and Swap (4GB). So for sure I need more swap space on machine. Canonical as well as askubuntu.com have some good information on how to replace swap-files. Rather than replacing files- I am going to with adding another one. This time 16GB. Here are the steps, you will need superuser access- I prefer sudo to su.
First allocate 16GB memory and mount as 16gb.swap. Also ensure that this file can’t be read by anyone and fill it with zeros
|
|
Once we have file allocated and intialized, create a swap volume out of it and then activate it.
|
|
If things go well, there won’t be an error on shell and you check the results from System Monitor or /proc/meminfo
output:
|
|
Or alternatively (see 19.9 GiB Swap Size):
So far all of this session only, for it to be made permanent: /etc/fstab needs to be tweaked. I opened up /etc/fstab vim, or any other text editor, and added an entry for 16gb.swap
That’s it.