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

sbe/stages/sort.cpp uses too much RAM

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • Fully Compatible
    • ALL
    • Programmability 2025-03-03, Programmability 2025-03-17
    • 200

      Compiling src/mongo/db/exec/sbe/stages/sort.cpp with gcc takes an extraordinary amount of memory, at around 3.5 GiB. This is enough to OoM the compiler intermittently.
      https://jira.mongodb.org/browse/BF-36760

      The pattern of including sorter.cpp at the bottom of a .cpp file should be eliminated.
      It is a very unusual C++ idiom and should be unnecessary. This was attempted in SERVER-62056 but reverted, so we should try again.

      The undeclared explicit template specializations that the #include...sorter.cpp pattern enables are not helping us. The same effect is achieved by renaming it to sorter_template_defs.h and including it selectively as we would any other header. The most important thing about sorter.cpp is that it is separated out from its public sorter.h header. As long as we preserve that separation we're ok.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: