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

BSONObj::memUsageForSorter() should use buffer size instead of object size

    • Query Execution

      The sorter's memory requirements depend on the buffer size of the index keys, but BSONObj::memUsageForSorter() uses the object size of the index keys. This requires the developer to ensure that the object size match the buffer size for index keys, or else the sorter's memory usage estimates will be off, and it can run out of memory. This leads to bugs like SERVER-25075 and SERVER-26488. It is still useful to optimize the buffer size for index keys for efficiency, but it would be better if forgetting to do so did not cause OOM failures.

      We would have to consider the performance implications of storing the buffer size of a BSONObj.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: