summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/memory_usage_tracker.h
diff options
context:
space:
mode:
authorProjjal Chanda <projjal.chanda@mongodb.com>2023-01-31 16:59:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-31 19:39:08 +0000
commit9afc315f73723d07c434fa738bdde25717bf7708 (patch)
treecd1b741fbe887117d101688aa5f815d21ece5bc9 /src/mongo/db/pipeline/memory_usage_tracker.h
parent7026efbe1c99aec1afc56629cc69f683a5599ab8 (diff)
downloadmongo-9afc315f73723d07c434fa738bdde25717bf7708.tar.gz
SERVER-69822: Use MemoryUsageTracker::withinMemoryLimit() consistently
Diffstat (limited to 'src/mongo/db/pipeline/memory_usage_tracker.h')
-rw-r--r--src/mongo/db/pipeline/memory_usage_tracker.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/memory_usage_tracker.h b/src/mongo/db/pipeline/memory_usage_tracker.h
index b91f0eb57ac..0984b320543 100644
--- a/src/mongo/db/pipeline/memory_usage_tracker.h
+++ b/src/mongo/db/pipeline/memory_usage_tracker.h
@@ -70,6 +70,10 @@ public:
return _maxMemoryBytes;
}
+ bool withinMemoryLimit() const {
+ return _currentMemoryBytes <= static_cast<long long>(base->_maxAllowedMemoryUsageBytes);
+ }
+
MemoryUsageTracker* base = nullptr;
private: