A common question that users new to EOS have is concerning the high levels of memory utilisation seen on Arista switches (~70% utilised). Typically this is first flagged by the NMS and triggers a low memory warning or alarm.
Unlike a traditional switching OS, EOS uses Linux page caching. Most free memory is used as a live cache and very low ‘free memory’ numbers are entirely normal, providing that enough memory is available from the buffers and cached memory for applications demanding more RAM.
In this case, the OS is capable of freeing up memory from cache as processes demand it.
|Memory that is||Typically Called||Linux Terminology|
|In use by processes e.g. agents||Used||Used|
|Not in use by processes but is used for other purposes*||Free||Used|
|Not in use at all||Free||Free|
* other purposes are typically for kernel caching and buffers
If we look at the memory utilisation on a switch:
# show process top memory once top - 11:44:40 up 10 days, 22:56, 2 users, load average: 0.33, 0.44, 0.49 Tasks: 265 total, 1 running, 264 sleeping, 0 stopped, 0 zombie Cpu(s): 18.0%us, 2.6%sy, 0.0%ni, 78.2%id, 0.0%wa, 1.1%hi, 0.1%si, 0.0%st Mem: 3781956k total, 3059348k used, 722608k free, 173348k buffers Swap: 0k total, 0k used, 0k free, 1676528k cached ...
Taking a simple measurement of memory utilisation (Used / Total) * 100, we could come to the conclusion that memory is 80% utilised, but 44% is being consumed by the cache – this can be made free as soon as any process requires that memory.
To correctly calculate the “Free” memory e.g. memory available for processes/agents to use if required, monitor the MemAvailable parameter from /proc/meminfo – available since EOS-4.17.0F.
MemAvailable is an estimate of how much memory is available for starting new applications, without swapping. It is calculated from MemFree, SReclaimable and some other parameters. The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system.
You can expect the amount of memory consumed by the cache to vary over time, depending on what the kernel decides to cache.