Memory leak in query PlanCache

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 2.5.5
    • Affects Version/s: 2.5.4
    • Component/s: Querying
    • Environment:
      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...
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

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

            Assignee:
            Benety Goh
            Reporter:
            Rui Zhang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: