4. Memory
Memory usage stands for the amount of memory that a webpage or an application uses while running. This metric, similarly to CPU usage, is a very good estimator of the utilization of our resources and should be closely observed and measured. By analyzing the memory usage we can decide if, for example, we’ll assign additional services to a virtual machine (VM) with low memory usage or upgrade the memory of a VM that has high memory usage.
One of the most common problems that may happen with memory utilization is a so-called memory leak. A memory leak means that your application allocates memory and uses it even when it’s no longer needed. Some of the most common reasons for a memory leak are:
- unbound timers – timers that are running forever
- unbound collections – references to arrays, sets, and maps that are kept forever
- accidental global variables – undeclared variables that become global and thus never get released
- closures – inner functions that are having a reference to outer functions’ variables.

The easiest way to detect such errors is by using application-performance monitoring, alerting, and anomaly detection tools.