I know about the concept of "Free RAM is wasted RAM". My question is how quickly and efficiently the OS can free up the cached RAM, so that apps have enough RAM in time of a spike in usage.
We have a web app hosted in linux. We normally have 10-20% memory utilisation. But we see spikes up to about 100% when certain parts of the code is invoked.(Code has been max optimised).I want to trigger an email when this happens. Should I write a script to monitor memory utilisation including Cache or just the application memory ?
When the Out of Memory error occurs in linux, does it means cache memory is zero and all the RAM has been already allocated to applications ?