Search code examples
cachingmemoryserver

Is server memory and server cache the same?


I read somewhere "A modern server has 144GB RAM memory", is that 144GB all used as cache? When we talk about a server's cache, does that mean the server's memory?


Solution

  • It all depends on the caching method utilized by the applications that run on the sever. There are numerous caching methods, but two methods frequently used are persistent Caching and In Memory Caching.

    With persistent cache, the application stores cache values somewhere intended to be “permanent”, such as the file system, database or otherwise.

    Whereas, with In Memory Caching, the application uses the memory (AKA RAM, in your question 144GB) to store data. Using this method, the data is intended to be semi-permanent and not persist across reboots, application recycles, or otherwise.

    If, when coding, you allocate a new object, dictionary, list or otherwise, these objects are stored in memory. Additionally, all of a servers memory is not available to the applications that run on said server. All operating systems and processes that are installed use the same RAM. Therefore, it’s common for a device that has 4GB RAM to only have 2GB reasonably usable, as the other 2GB is used by the operating system. Of course, these numbers depend on a lot of factors.