troubleshooting Question

Why system is swapping without reclaiming huge cached memory

Avatar of Franck Pachot
Franck PachotFlag for Switzerland asked on
Linux
10 Comments1 Solution815 ViewsLast Modified:
Hi,

I'm on a system that experiences swapping.
However, I have 4GB for 'cached' and I expected that the cache can be reclaimed under memory pressure.

top - 10:57:10 up 8 days,  2:49,  2 users,  load average: 0.18, 0.36, 0.46
Tasks: 645 total,   1 running, 644 sleeping,   0 stopped,   0 zombie
Cpu(s):  9.6%us,  8.9%sy,  0.0%ni, 81.0%id,  0.4%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:   8126148k total,  7963148k used,   163000k free,     6912k buffers
Swap: 25165816k total,  6066084k used, 19099732k free,  4103596k cached
Do I interpret that correctly when I say that only 4GB of physical memory is used by the processes and the unused part serves as cache ?

Here is detail from sar (big swapping issue at 09:50)

sar -r
            kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit
09:30:01 AM    134444   7991704     98.35     10332   4028216  19971452     59.99
09:40:01 AM    160784   7965364     98.02     10388   4048288  19818544     59.53
09:50:01 AM    128004   7998144     98.42      4868   4027960  19852052     59.63
10:00:01 AM    141856   7984292     98.25      6392   4151896  20006856     60.10
10:10:01 AM    195496   7930652     97.59     14352   4190944  19803992     59.49
10:20:04 AM    144424   7981724     98.22      4552   4256120  19811740     59.51
10:30:01 AM    155312   7970836     98.09      8248   4215552  19963548     59.97
Average:       193411   7932737     97.62     16036   3977477  19849017     59.62

sar -S
            kbswpfree kbswpused  %swpused  kbswpcad   %swpcad
09:30:01 AM  19083496   6082320     24.17    877932     14.43
09:40:01 AM  19099620   6066196     24.10    839472     13.84
09:50:01 AM  19130128   6035688     23.98    864112     14.32
10:00:01 AM  19206012   5959804     23.68    697464     11.70
10:10:01 AM  19228044   5937772     23.59    671576     11.31
10:20:04 AM  19245732   5920084     23.52    738748     12.48
10:30:01 AM  19188576   5977240     23.75    744344     12.45
Average:     18987125   6178691     24.55    934020     15.12

sar -B
             pgpgin/s pgpgout/s   fault/s  majflt/s  pgfree/s pgscank/s pgscand/s pgsteal/s    %vmeff
09:30:01 AM  11740.51    447.41  10604.60     15.65   3232.52    168.66     15.14    131.06     71.31
09:40:01 AM   7884.12   1225.61  10787.88     10.01   3223.09     87.22     18.81     83.75     78.99
09:50:01 AM   7657.48    475.55  10900.24     34.10   3402.93    309.62      9.57    243.68     76.34
10:00:01 AM   9923.26    677.34  11654.52     81.67   4279.32    835.99     17.22    632.46     74.13
10:10:01 AM   7943.10    399.23  10848.28     17.25   3200.36    108.03      9.29     88.78     75.66
10:20:04 AM  11178.82   1094.43  13837.84    146.95   5561.22   1372.39    123.54   1101.29     73.62
10:30:01 AM   8651.50    491.58  10718.29     16.86   3267.58    242.49     19.85    205.83     78.46
10:40:01 AM   8092.91    851.57  10575.16     19.10   3188.81    160.80     22.52    142.26     77.60
Average:     10435.52    622.72  10827.20     11.70   3233.49    102.95     24.56     96.19     75.44

But I'm not a specialist. What is the meaning of 'cached' and should I consider it as used or available memory ?

Thanks,
Franck.
ASKER CERTIFIED SOLUTION
Seth Simmons
Lead Systems Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros