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

Severe memory leak in mongos on simple queries

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.3.5
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Environment:
      Ubuntu 9.10, i386

      Mongos seems to leak on every findOne query.

      How to reproduce? I've configured sharding using example script: http://github.com/mongodb/mongo-snippets/blob/master/sharding/first.js
      I ran this script once and then tried to benchmark query time using the following code in the client:

      for (i = 0; i < 400; i ++) { for (num = 0; num < 100; num ++) { db.data.findOne(

      {"num" : num}

      ) }; } 1;

      When running this code I noticed mongos quickly grows in size in memory. Restarting client doesn't seem to release any memory resources in mongos. I could reproduce it first with mongodb 1.2.0, then I tried 1.2.2, 1.3.1 and finally with the latest git and all versions showed the problem. I'm sorry, I'm not sure how mongodb version number maps to version number of mongos so I've set only latest release and unreleased version numbers in jira's selection box but I guess it probably affects all versions.

      P.S. I've tried to run mongos under valgrind and it confirms the problem. See the attached valgrind log.

        1. valgrind.log
          57 kB
        2. valgrind.log
          44 kB

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            ilyam Ilya Martynov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: