Checking the swap in Linux

Author: Eugene Taylor
Date Of Creation: 13 August 2021
Update Date: 18 June 2024
Anonim
Что такое SWAP linux, как он работает? Создание swap файла linux
Video: Что такое SWAP linux, как он работает? Создание swap файла linux

Content

Linux uses a swap memory as a buffer for the internal memory. In most cases, the size of the swap memory is the same as the size of the internal memory you have installed. Below we show what the swap memory of your system looks like and how it is used.

To step

  1. Log in with your root account and enter the command "swapon -s". You will now see the allocated swap memory, if your system has one. The image above shows what you will see with this command.
  2. Enter the command "free". This shows how the memory and swap are used. The image above shows what you will see with this command.
  3. In both overviews, look at the space used in relation to the total size of the memory. If a large portion of the swap is being used, you can do two things. You can expand the swap memory with an extra disk, or you can install more internal memory.

Tips

  • You can also view your swap with the "mount" command, but you will not see the allocated and used disk space.

Warnings

  • Expanding the swap memory is not always the solution. If you have to use the swap memory, it means that you have too little internal memory and swapping memory takes time. Your system will therefore perform less well. If you are using the swap and your system is not performing well, installing more memory may be a better solution.