Discussion Locked

Swap is not useing

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

If I say free when system boots it show 0% useage of swap.
How to make use of swap?

5 replies

by cpfeiffe

This is actually a good thing. Not using swap means you still have free RAM. swap will be utilized when you are out of RAM. Process data will be swapped out of RAM and to disk memory (swap) when new processes need to load their data into RAM. Then processes will continue to swap data in out of RAM/swap as it is needed (data can only be processed in RAM, but it can be idle in swap). The only problem with having 0% swap usage is if you have allocated too much swap space and you don't want towaste this disk space. The general recommendation in unix is for swap to be at least the size of RAM (because of how some applications reserve memory) and if you are allowing dumps on your system you should have enough space for the dumps as well.Usually 2 X RAM is sufficient. This fits well on an average configuration, but the more RAM you have the less swap you need. If you have so much RAM that swap is never used for memory data then it only needs to be there for dumps (still needs to be equal to the amount of RAM you have for this to work). Basically, this is a good thing and if you've over-allocated then you want to reconfigure your disk to use less swap. Once you start using swap (instead of maintaining all data in RAM) your system will slow. I hope this was helpful.

by r.e.c.

Make sure you actually have a swap partion/file available.
Type the command:
swapon -s
in a console to see if swap is availble.
If you have plenty of memory (RAM), you may not be using swap as the first response to your question stated.

If you don't have swap space set up, post another question on how to do this.

This discussion is closed to new replies.