From: Otto Date: Wed, 10 Mar 2021 10:45:02 +0000 (+0100) Subject: "data" size is unreliable, start using RES, as it seem reliable and relevant X-Git-Tag: rec-4.5.0-beta1~35^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10161%2Fhead;p=thirdparty%2Fpdns.git "data" size is unreliable, start using RES, as it seem reliable and relevant --- diff --git a/pdns/misc.cc b/pdns/misc.cc index de9e003eb9..dc21e6d9c3 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -1270,7 +1270,9 @@ uint64_t getRealMemoryUsage(const std::string&) uint64_t size, resident, shared, text, lib, data; ifs >> size >> resident >> shared >> text >> lib >> data; - return data * getpagesize(); + // We used to use "data" here, but it proves unreliable and even is marked "broken" + // in https://www.kernel.org/doc/html/latest/filesystems/proc.html + return resident * getpagesize(); #else struct rusage ru; if (getrusage(RUSAGE_SELF, &ru) != 0)