My Coding >
Operational systems >
Ubuntu >
Ubuntu FAQ >
How to increase swap space in Ubuntu
How to increase swap space in UbuntuA very common problem is when we need to run memory memory-consuming applications and we lack free RAM and the swap is not big enough. In this case, we need to increase swap space, and it is possible to do it on the fly, without restarting the computer. Usually, swap is 1000, or even more times slower than RAM, but this is not crucial, because it is a very common case, when a lot of memory is consumed by applications which do not require high performance at this point and they are okay to be kept is low swap space. Check memory statusTo check memory status, you can run command top, or use any graphical monitors
However, it is more professional to check the status of the system with special commands. It is important to understand, shat swap is a system util and some of the operations required ROOT or SU priority. It is possible to see by the sudo command at the beginning of these commands subsequently entering the root password. Check the status of the swap:
the result will be something similar to:
As you can see, I have two swap files To check the total memory, use the command:
The results will be like this one:
This is the overall status of the memory. It is also important to understand, that you need to have enough space on the hard drive, and also, if you have a few hard drives, then you need to choose the fastest one. Installing SWAPCreate the swap (/swapfile1) file with the size of 32GB.
Change the mode of this file to be accessible for reading and writing only by root
Now, this file should be converted into a swap format by command:
That is, the file is ready and it can be activated by the command:
Now you can check the status of the memory by describing the above commands, it is easy. Permanent swapThis swap file will work only in this session, and after rebooting it will be disconnected. To make it connected, it is necessary to aff the following line: /swapfile1 none swap sw 0 0 to the file /etc/fstab. But before modifications, it is a good idea to make a backup copy of this file:
This is how we do it in real-time:
|
Last 10 artitles
9 popular artitles
|
|||||
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |