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

Memory leak in query PlanCache

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • 2.5.5
    • 2.5.4
    • Querying
    • SHA & Build Infor:
      04221630900335fc6ee0d9922edae9d29f02d66d
      Build 2014-01-03
      x86_64

      Tested with Ec2 Mongodb AMI
    • Fully Compatible
    • ALL
    • Hide

      Add some data to your db (5 gb is fine). Then:

      db.foo.ensureIndex({x:1})
      while (true) { db.foo.insert({x:1}); db.foo.remove({x:1});}

      Run multiple while(true) loops to leak faster...

      Show
      Add some data to your db (5 gb is fine). Then: db.foo.ensureIndex({x:1}) while (true) { db.foo.insert({x:1}); db.foo.remove({x:1});} Run multiple while(true) loops to leak faster...

    Description

      Running a simple operation (such as insert, remove the same document, in a loop) will result in heap space growth. See attached svg for heap analyzer result, which targets a std::vector and the stuff we're storing in it, within PlanCache. See reproduction steps above, for debugging.

      Attachments

        1. dmesg.log
          9 kB
        2. memory_trend_248_vs_255.png
          memory_trend_248_vs_255.png
          83 kB
        3. memory_trend_255.png
          memory_trend_255.png
          36 kB
        4. plancacheleak.svg
          80 kB

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            rui.zhang Rui Zhang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: