openr icon indicating copy to clipboard operation
openr copied to clipboard

Failed to read thread allocated/de-allocated bytes: mallctl: not using jemalloc

Open guodong opened this issue 2 years ago • 0 comments

Please use this template for reporting suspected bugs or requests for help.

Issue Description

I have built OpenR and tested it in a mininet env. But the log on each instance shows the following error:

E0708 02:45:17.745582 266847 Util.cpp:190] Failed to read thread allocated/de-allocated bytes: mallctl: not using jemalloc

Environment

  • tag or commit hash on which this occured: 660c13e0034239cd6bf28c2ec8933512f9217e98
  • OS version: Ubuntu 20.04

It seems that the error is not fatal to break OpenR, is it an incorrect invoke of folly?

Code in Util.cpp that throws the error:

uint64_t
getThreadBytesImpl(bool isAllocated) {
  uint64_t bytes{0};
  const char* cmd = isAllocated ? "thread.allocated" : "thread.deallocated";
  try {
    folly::mallctlRead(cmd, &bytes);
  } catch (const std::exception& ex) {
    XLOG(ERR) << "Failed to read thread allocated/de-allocated bytes: "
              << ex.what();
  }
  return bytes;
}

guodong avatar Jul 08 '22 02:07 guodong