Ubuntu default swap is not enough.
remark:
1) Ubuntu version: 14.04
2) Linux users: Root
Typically, a swap partition in a Linux system can be specified in two ways: one, a swap partition when the disk is partitioned, and a swap file in the file system as a swap partition. This article mainly introduces the second way. The steps are as follows:
1. Create a file
fallocate-l 8g/swapfile
Description: 8G indicates the swap file size,/swapfile is the swap file path and name, can be arbitrarily specified.
2. Modify File Permissions
chmod 600/swapfile
3. Initialize the swapfile as a swap file
Mkswap/swapfile
4. Enable swap files
Swapon/swapfile
5. At this point, the Linux system has used Swapfile as a swap file, but after the reboot is not automatically suspended in the file you just created, so you need to manually modify the/etc/fstab configuration file:
Gedit/etc/fstab
Add the following content to the file:
/swapfile None swap SW 0 0
6. Complete, test under:
swapon-s
Tips:
If you need to unmount a swap partition file, you can use the command: Swapoff/swapfile
"Reference":
http://www.linuxidc.com/Linux/2014-08/105223.htm
This article from "Do not forget Beginner's mind Oracle" blog, declined reprint!
Ubuntu Add swap