free -m on my Linux machine shows that swap memory is almost completely used. However,there is no impact on the system performance. But should i be really bothered? Swap cache also is not used to its fullest? So will this actually impact the performance? Please suggest

free -k

           total       used       free     shared    buffers     cached
Mem:      32959100   32786348     172752          0      85096   30303388
-/+ buffers/cache:    2397864   30561236
Swap:      4192956    4188456       4500

cat /proc/meminfo|grep Swap

SwapCached:     184012 kB
SwapTotal:     4192956 kB
SwapFree:        11584 kB

swappiness is 60

Also we can see that lot of free memory under buffers/cache is available .So why is my swap memory used heavily??How will it effect the performance in future?

  • Am I reading correctly that you have 32GB of RAM and only 4GB of swap? That doesn't seem like enough to allow your system to make good use of your RAM. – David Schwartz Nov 24 '14 at 8:51
  • True.The servers has most runs related to oracle.I need to prove my DBA that more SWAP partition is needed.Any kind of supportive script/doc is appreciated – divya Nov 24 '14 at 9:14

Judging by the answer to this question on Sever Fault it looks like all your swap file is in use but you are not even remotely coming close to being memory starved.

The buffers/cache line suggests that while you do have 30gb of memory in the disk cache, most of it is ready to be freed when needed. If the larger number was in the "used" column then you would have a large quantity of data waiting to be written to disk.

As it is the fact that it is all just cached data I would suspect you have 2gb of live application data in memory and the rest being used by the disk cache.

It is entirely possible that linux has preemptively pages out all the application data it can, but that the data is still stored in RAM as well. Just because your page file is full does not mean that you have no memory available for the system to use.

To quote the page I linked:

A Linux system is really low on memory if the free value in -/+ buffers/cache: line gets low.

  • Thank you..However i doubt that if swap space is being extensively used wont it bring down the system performance as it takes time to write in and out of disk?? – divya Nov 25 '14 at 4:06
  • Linux has already paged out what it thinks is relevant to be paged out. Sure it might decide to bring something back in so it can page something else out, but if you're not running up new apps then I expect the amount of data going through the swap will be quite low. Linux is a bit of an aggressive paging system and from what I remember is able to page stuff out and leave it in memory (in the cache) at the same time. The swap file will not be being used as a write-through cache for memory. If you really had a problem I would expect the buffers/cache line to be low as I mentioned in my answer – Mokubai Nov 25 '14 at 8:37
  • In part I would probably agree that the system could benefit from more swap space, but if it takes anything more than 15 to 20 minutes to implement then it is probably costing more time and effort than it will ever save. This is probably the logic that your bosses are using. It might help, but the system has a boatload of memory and is not resource starved so the job is massively low priority. – Mokubai Nov 25 '14 at 9:53
  • yes.This concern for swap arises as sometimes the SwapFree shows 0KB as well.However it makes snese since there is huge cache available system doesn't crash out of memory.How do i know the effect of swap being used on system performance?asking this out of curiosity :) – divya Nov 25 '14 at 10:24

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.