summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/util/processinfo_linux.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index ae3a1ca414c..4ac9d72842c 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -410,12 +410,16 @@ public:
/*
* If memory is being limited by the applied control group and it's less
* than the OS system memory (default cgroup limit is ulonglong max) let's
- * return the actual memory we'll have available to the process.
+ * return the actual memory we'll have available to the process.
*/
unsigned long long cgroupMemBytes = 0;
- std::string cgmemlimit = readLineFromFile("/sys/fs/cgroup/memory/memory.limit_in_bytes");
- if (!cgmemlimit.empty() && mongo::parseNumberFromString(cgmemlimit, &cgroupMemBytes).isOK() && cgroupMemBytes < systemMemBytes) {
- log() << "cgroup memory limit of " << cgroupMemBytes << " bytes detected -- using this as the applicable memory limit";
+ std::string cgmemlimit =
+ readLineFromFile("/sys/fs/cgroup/memory/memory.limit_in_bytes");
+ if (!cgmemlimit.empty() &&
+ mongo::parseNumberFromString(cgmemlimit, &cgroupMemBytes).isOK() &&
+ cgroupMemBytes < systemMemBytes) {
+ log() << "cgroup memory limit of " << cgroupMemBytes
+ << " bytes detected -- using this as the applicable memory limit";
return cgroupMemBytes;
}