summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/memory_usage_tracker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/memory_usage_tracker.h')
-rw-r--r--src/mongo/db/pipeline/memory_usage_tracker.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/mongo/db/pipeline/memory_usage_tracker.h b/src/mongo/db/pipeline/memory_usage_tracker.h
index 275183081ef..b91f0eb57ac 100644
--- a/src/mongo/db/pipeline/memory_usage_tracker.h
+++ b/src/mongo/db/pipeline/memory_usage_tracker.h
@@ -50,20 +50,8 @@ public:
PerFunctionMemoryTracker() = delete;
void update(long long diff) {
-
- // TODO SERVER-61281: this is a temporary measure in tackling the problem in this
- // ticket. It prevents the underflow from happening but doesn't address the cause
- // which is inaccurate tracking.
- // Once inaccurate tracking is resolved, the underflow assertion below could be
- // restored.
- // tassert(5578603,
- // str::stream() << "Underflow on memory tracking, attempting to add " <<
- // diff
- // << " but only " << _currentMemoryBytes << " available",
- // diff >= 0 || _currentMemoryBytes >= std::abs(diff));
- // set(_currentMemoryBytes + diff);
-
- set(std::max(_currentMemoryBytes + diff, 0LL));
+ // TODO SERVER-61281: Check for memory underflow.
+ set(std::max(_currentMemoryBytes + diff, 0ll));
}
void set(long long total) {
@@ -154,11 +142,8 @@ public:
* Updates total memory usage.
*/
void update(long long diff) {
- tassert(5578602,
- str::stream() << "Underflow on memory tracking, attempting to add " << diff
- << " but only " << _memoryUsageBytes << " available",
- diff >= 0 || (int)_memoryUsageBytes >= -1 * diff);
- set(_memoryUsageBytes + diff);
+ // TODO SERVER-61281: Check for memory underflow.
+ set(std::max(_memoryUsageBytes + diff, 0ll));
}
auto currentMemoryBytes() const {