Large Cache Memory Help

Hello linuxers,

I’m running a CentOS server (specs below) with 32 GB memory. My problem is 18.49 GB of the 32GB is used by cache. That seems to be a lot. Is that a good thing or cache is using too much? I’m running a live cryptocurrency prices website. I cache a lot of stuff because I’m using API to pull cryptocurrency prices.

Is cache keeping the site from running out of memory or it’s using too much and I should I reduce the number of pages cache? If I don’t cache so much, will my the site slows down?


OS: CentOS Linux 7.7.1908 (Core)

CPU: Intel® Xeon® CPU E3-1225 v3 @ 3.20GHz (4 core(s))


System Uptime: 3 day(s) 09:58

Total memory: 31.17 GB

Used: 20.04 GB

Cache: 18.49 GB

Hello Obre,
I think it shouldn’t be a problem as described in this Linux article

But If you can show us the output of the command
free -m

just to make sure.

Thank you.

Thanks for replying. Output:

          total        used        free      shared  buff/cache   available

Mem: 31921 1621 7980 274 22318 29634
Swap: 16367 0 16367

Hi ObreSun,

Thank you. Sorry, I forgot to ask this: plese provide also the output of

cat /proc/meminfo

Thank you.

Also u might want to check for killed processes (by the kernel) due to out of memory issues in the past (from your output it doesn’t seem there’s this risk currently )

dmesg|grep -i "killed process"
if u have root access to the system
grep -i ‘killed process’ /var/log/messages

MemTotal: 32687160 kB
MemFree: 1827696 kB
MemAvailable: 30691832 kB
Buffers: 227956 kB
Cached: 7131044 kB
SwapCached: 20 kB
Active: 3404700 kB
Inactive: 4962904 kB
Active(anon): 1178464 kB
Inactive(anon): 128212 kB
Active(file): 2226236 kB
Inactive(file): 4834692 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 16760828 kB
SwapFree: 16760572 kB
Dirty: 140 kB
Writeback: 0 kB
AnonPages: 1008584 kB
Mapped: 153280 kB
Shmem: 298072 kB
Slab: 22235952 kB
SReclaimable: 22203908 kB
SUnreclaim: 32044 kB
KernelStack: 6288 kB
PageTables: 23896 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 33104408 kB
Committed_AS: 4307284 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 128104 kB
VmallocChunk: 34359537660 kB
HardwareCorrupted: 0 kB
AnonHugePages: 567296 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 156292 kB
DirectMap2M: 4993024 kB
DirectMap1G: 28311552 kB

Hi again,
basically Buffers and Cached memory are not considered “used” memory.
They are explained as :
Buffers: Memory in buffer cache, so relatively temporary storage for raw disk blocks. This shouldn’t get very large.
Cached: Memory in the pagecache (Diskcache and Shared Memory)

In RHEL/CentOS 7.x in fact, used memory is considered as

MemTotal - MemFree - Buffers - Cached - Slab

Unless there is high swapping or out of memory errors messages in the logs, there should not be reason to concern. Of course the posted values are static I cannot see any trend without some monitoring tool graph.

Yeah, I just read that it’s not considered used memory. Thanks for all your help.