Cache memory too high

Latest response

Hi,

we are facing cache memory utilization is too high from past few days on our production server. Due to that, we unable to start any application until unless we freed the cache manually. Hence, we want to find out which process utilized high cache memory. Could you please help how to find out that.

Jagadeesh Ramasamy's picture

Responses

Hi,

Do you use THP? If so, what are the THP stats:

grep thp /proc/vmstat grep AnnonH /proc/memstat free -m

This is a good article which explains about "cache" https://access.redhat.com/solutions/67610.

You would need to provide more details on this topic so that anyone on the forum would give suggestion or ideas. You had mentioned that cache memory utilization is high does this means even swap usage is more? This is all managed by kernel. So, as an admin at most cases we don't worry about such, however, sometimes yes we start to think/analyze why this is happening, which process is consuming more memory etc., If you run "ps up " command for any processes then you would get to see "RSS" & "VSZ" values which identifies "total virtual memory mapped with physical memory" and "total amount of virtual memory that the process has requested for" respectively. So, the RSS would show up actual physical memory being consumed.

Again, swap usage should also not be a concern since kernel would manage it and whenever required move in/out of pages from disk to memory, however, if there are a lot of swap-in activities happening then certainly it is a concern since moving a page from disk to memory would take time. As Kamil said you would need to run vmstat or other commands to find out the statistics. So, let us know the commands that you had run and other observations that you come across for further help. Also, don't forget to write about RHEL version being used, kernel version etc..

Thanks Sadashiva for getting back. It's RHEL 6.8. There is free in RAM and SWAP. But, cache consumed 70% of total memory. Due to that, process unable to start(getting like, there is no such free memory) until we clear the cache manually. Is there any way to find out what is using by cache memory?

Jagadeesh, pages in cache would get re-claimed by memory management sub-system as and when required and this is managed by kernel. There is this famous saying 'un-used memory in linux is a wasted memory', so kernel would keep pages which are read/written from disk in primary memory which is RAM for latter re-use and this gets filled up as system usage grows. The mechanism of cleaning up these pages in cache would be done by kernel whenever a memory request comes in, however, if a system is of very less free memory and also swapping pages then it could indicate that system would need more memory. First, I'd say that you would need to understand more about memory management in linux so, please look into this article which explains all this : https://access.redhat.com/solutions/67610.

Also, you may post the /proc/meminfo details here.

Was this helpful?

We appreciate your feedback. Leave a comment if you would like to provide more detail.
It looks like we have some work to do. Leave a comment to let us know how we could improve.
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.