Setup of virtual memory for Linux (Ubuntu)
Swap space is virtual memory, which is of great use when physical memory is low.
View memory Size: free-m//M indicates the displayed byte unit is m (megabytes)
Let's add the Swap size to the system. Www.2cto.com
1. First use the command free to view the Swap partition size within the system.
Free-m
Total used free shared buffers Cached
MEM:1002 964 38 0 21 410
-/+ buffers/cache:532 470
swap:951 32 929
You can see that Swap is only 951M and does not meet the installation requirements of oracle-xe-client.
2. Create a Swap file.
mkdir Swap
CD Swap www.2cto.com
sudo dd if=/dev/zero of=swapfile bs=1024 count=100000
The following prompt appears, and count in the above command represents the swap file size.
Recorded 100000+0 read-in
Recorded the writing of 100000+0.
102400000 bytes (102 MB) Replicated, 0.74704 sec, 137 mb/sec
Convert generated files to Swap files
sudo mkswap swapfile
Setting up Swapspace version 1, size = 102395 KB
No label, uuid=09fde987-5567-498a-a60b-477e302a988b
3. Activate the Swap file.
sudo swapon swapfile
Review the results of the free-m again.
Total used free shared buffers Cached
Mem:1002 967 34 0 22 410
-/+ buffers/cache:534 467
swap:1053 1021 www.2cto.com
Added successfully.
Extended:
If you need to uninstall this swap file, you can enter the created swap file directory. Execute the following command.
sudo swapoff swapfile
If you need to keep this swap, you can change sudo-s to root
Then write it to the/etc/fstab file.
Swapfilepath swap swap defaults 0 0
Setup of virtual memory for Linux (Ubuntu)