Batched Memory Tracker updates in Expression Evaluation

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.0.0-rc2
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • v9.0
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Expression evaluation runs on the hot path and each step typically touches only a small, transient amount of memory that is released as soon as the evaluation finishes. With the current memory tracking, every one of those small add() / assertWithinMemory() calls propagates up the tracker's base chain to the operation-wide tracker, performs a memory-limit check, and can write the updated usage to CurOp. That per-operand coordination is far more expensive than the tiny allocation it accounts for, and its cost scales with the number of operands, so for cheap, high-frequency expressions the tracking overhead dominates.

       

      The fix is to track locally and flush to the tracker chain periodically.

            Assignee:
            Foteini Alvanaki
            Reporter:
            Foteini Alvanaki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: