Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-748

Memory leak when inserting

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.2
    • Component/s: None
    • Environment:
      OS:
      ubuntu 14.04 LTS 64-bit

      Python:
      2.7.6 | 64-bit | (default, Jun 4 2014, 16:32:15)
      [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]

      PyMongo:
      2.7.2

      PyMongo leaks memory when inserting records into the database. A script is attached to reproduce the problem assuming that a mongod instance is running locally. The same problem is not reproducible on Mac OS X 10.9.4.

      The memory leak occurs rarely ~0.2% of the inserts but it leaks exactly 4096 bytes whenever it occurs (except for the first call to insert where I expect some setup work is being done). Calling `close` on the `MongoClient` object does not release the memory.

        1. script.py
          1 kB
          Till Hoffmann

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            tillahoffmann Till Hoffmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: