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

mongod leaks memory at ~4.8 MB/s when inserting documents at a high rate

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.2.3
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
      1. Run perfmon and add mongod Private Bytes counter
      2. Restart mongod service
      3. Run the attached script and keep an eye on perfmon
      4. After the script finishes, you can start it again and the pattern will continue

      Running the attached Mongo shell script with perfmon shows mongod's Private Bytes grow at 4.8 MB/s. The gap in the middle is when the test finished the first time. When it was then restarted, memory kept climbing.

      Interestingly enough, if the test collection is dropped at the end of the test, then when the script is launched again, memory stays at the same level for a while. I didn't have the time to look closer into further behavior. If the collection is left alone and the script is restarted, memory keeps climbing.

      I see the same behavior in the application.

      Make sure to restart mongod when running it for the first time - it appears that it uses existing memory for a while and it is not as easy to spot the leak.

       

        1. mongod-mem-consumption-10M-docs-1-client.png
          mongod-mem-consumption-10M-docs-1-client.png
          234 kB
        2. mongod-mem-consumption-10M-docs-1-client-docs-per-sec.png
          mongod-mem-consumption-10M-docs-1-client-docs-per-sec.png
          17 kB
        3. mongod-mem-consumption-10M-docs-3-clients.png
          mongod-mem-consumption-10M-docs-3-clients.png
          244 kB
        4. mongod-mem-consumption-10M-docs-3-clients-docs-per-sec.png
          mongod-mem-consumption-10M-docs-3-clients-docs-per-sec.png
          33 kB
        5. mongod-mem-leak.js
          0.7 kB
        6. mongod-mem-leak.png
          mongod-mem-leak.png
          246 kB
        7. SERVER-47066.png
          SERVER-47066.png
          172 kB

            Assignee:
            dmitry.agranat@mongodb.com Dmitry Agranat
            Reporter:
            cis74633@bell.net Andre M
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: