How to Check Swap Space in Linux: 3 Steps

Table of contents:

How to Check Swap Space in Linux: 3 Steps
How to Check Swap Space in Linux: 3 Steps
Anonim

Linux, like all operating systems, uses the 'swap' process, when the system RAM memory occupancy reaches its physical limit. In Linux, in most cases, 'swap space' consists of an amount of free hard disk space, equivalent to the amount of RAM installed on the system. This tutorial shows you how to check how much swap space is configured and currently used from your system.

Steps

Check Swap Space in Linux Step 1
Check Swap Space in Linux Step 1

Step 1. Type the command 'swapon -s' (without quotes) after logging in as the 'root' user

This command shows the swap disk (s) allocated on your system, if any, of course. The result of the command should be similar to that shown in the illustrative figure of this step.

Check Swap Space in Linux Step 2
Check Swap Space in Linux Step 2

Step 2. Type the command 'free' (without quotes)

RAM usage and swap disk usage will be displayed. The result of the command should be similar to that shown in the illustrative figure of this step.

Check Swap Space in Linux Step 3
Check Swap Space in Linux Step 3

Step 3. Now compare the displayed values for the space used and the total space available

If a large percentage of the swap space is in use, you can choose one of these two options to solve the problem: decide to increase the space available on the swap disk, or install more RAM in the system.

Recommended: