Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-69822

Use MemoryUsageTracker::withinMemoryLimit() consistently

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Execution
    • Fully Compatible

      MemoryUsageTracker::withinMemoryLimit() wraps

      return _memoryUsageBytes <= static_cast<long long>(_maxAllowedMemoryUsageBytes);
      

      However, there are multiple places in the code where this comparison is done explicitly with different predicates '<', '=>', '>', which can be confusing.

      I propose to replace these comparisons with withinMemoryLimit() or !withinMemoryLimit() whenever possible for clarity and consistency.

            Assignee:
            projjal.chanda@mongodb.com Projjal Chanda
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: