diff --git a/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs b/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs index 116bb5c47e..0cb69e84a4 100644 --- a/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs +++ b/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs @@ -63,6 +63,10 @@ internal static (long totalMemory, long availableMemory) GetTotalAndAvailableSys try { + // We read from the file into our rented buffer so that we can parse data from the meminfo file. + // Specifically, we try to parse the values for `MemAvailable` and `MemTotal`. When these values + // use the KB unit, we multiply them to return bytes. + var read = fs.Read(buffer); if (read == 0)