0

Before:

memory 8G, swap:8G

After:

after adding 8G memory, the swap doesn't work

enter image description here

how can I activate it?

OS: CentOS 7, 64bit.

  • 1
    Use swapon to activate a newly created swap space. – heemayl Jan 17 '17 at 4:57
  • 1
    Your swap is already active. Operating System will swap out memory pages that it doesn't need when it's necessary automatically – Sergiy Kolodyazhnyy Jan 17 '17 at 5:23
1

You can confirm that swap is activated and how much is being used with:

swapon --show

As an aside, if you want to check memory usage without htop you can use:

free  

That said, what you have already shown indicates that you likely do not have any problems with your swap.

2

The Swap is configured correctly and we can see it in the image posted.

There is no separate step to activate swap. Swap is used only when system runs out of RAM. Your system has enough RAM for all the running applications.

The image you have posted shows that there is 7.75GB of swap and not used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.