swap not used though memory full

Posted January 21, 2021 174 views
CentOSServer Optimization


I found on Centos7, memory utilization is above 90% still swap is 0 mb in use.

[xxx@z ~]$ free -m
              total        used        free      shared  buff/cache   available
Mem:           7682        1457         151         155        6073        5772
Swap:          7935           0        7935

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there,

The important measure is the available which in your case is 5772MB. So nearly 75% of your memory is available.

Only if your available memory is full, only then the system will start writing to the swap.

Also very important side note, I would really not advisable having such a huge swap file, as if the system starts storing so much information in swap it could really slow things down.