From 73f188f54ac99b0ee3513a88cc71d23489cbb845 Mon Sep 17 00:00:00 2001 From: Beq Date: Thu, 20 Jul 2023 15:15:45 +0100 Subject: [PATCH] fix unit conversion error in Linux RSS --- indra/llcommon/llmemory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index d0a8cac951..9bade9ea69 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -263,6 +263,7 @@ U64 LLMemory::getCurrentRSS() #include #include +// return the RSS in bytes. This value is converted to kilobytes implicitly elsewhere. U64 LLMemory::getCurrentRSS() { namespace fs = std::filesystem; @@ -286,8 +287,8 @@ U64 LLMemory::getCurrentRSS() { long size, rss, shared, text, lib, data, dt; iss >> size >> rss >> shared >> text >> lib >> data >> dt; - // Convert pages to kilobytes and return RSS - return static_cast(rss * pageSize / 1024); + // Convert pages to bytes and return RSS + return static_cast( rss * pageSize ); } // #else