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

[4.2] Calculate index build memory usage per key based on BSONObj buffer capacity, not size

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.0, 4.0.0, 4.2.0
    • Fix Version/s: 4.2.3
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Execution Team 2019-12-30
    • Linked BF Score:
      0

      Description

      Index builds limit their memory usage with the parameter maxIndexBuildMemoryUsageMegabytes, which defaults to 500MB. The memory usage calculation depends on the BSONObj accurately reporting its memory usuage in memUsageForSorter().

      BSONObj reports its memory usage as the size of the object, but not the capacity of the buffer holding that object. This is problematic because index builds can use significantly more memory than they they should.

      We should change the imlementation of memUsageForSorter() to report the size of the underlying SharedBuffer, in a very similar way to  what we did for in SERVER-42931.

       

       

        Attachments

          Activity

            People

            Assignee:
            milkie Eric Milkie
            Reporter:
            louis.williams Louis Williams
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: