fix unit conversion error in Linux RSS

meow-7.2.2
Beq 2023-07-20 15:15:45 +01:00
parent 2a54d9efd0
commit 73f188f54a
1 changed files with 3 additions and 2 deletions

View File

@ -263,6 +263,7 @@ U64 LLMemory::getCurrentRSS()
#include <filesystem>
#include <unistd.h>
// 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<U64>(rss * pageSize / 1024);
// Convert pages to bytes and return RSS
return static_cast<U64>( rss * pageSize );
}
// </FS:Beq>
#else