From 25c469dad31cf2a528e60cb291bf5d7879c73af4 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 15 Nov 2023 09:18:05 +0000 Subject: [PATCH] Add code comment --- src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs b/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs index 116bb5c47..0cb69e84a 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)