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

Growth of ServerDescription and AutoReconnect objects leads to memory leak

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.11.2
    • Affects Version/s: 3.11, 3.11.1
    • Component/s: Monitoring
    • None
    • Environment:
      ubuntu 16.04
      Python 3.6.8

        My application use motor 2.0.0 and pymongo 3.11.0 to connect Mongodb cluster , but  when I mistakenly filled in IP as follows,

      connector = motor.motor_tornado.MotorClient(‘192.168.0.10, 192.168.0.11’, 27017)

         There is a space character bewteen ',' and '192.168.0.11', so the application cann't connect to 192.168.0.11:27017 mongos process.  But that doesn't affect the app because the first IP is available,and I find that the memory used by the application grows slowly.

        Then I use memory_analyzer tool to profile memory useage. There were 309 ServerDescription objects and 307 AutoReconnect objects at 2020-11-16 16:55:14, 

      6610 ServerDescription objects and 6607 AutoReconnect objects at 2020-11-17 10:26:43, the result shows both of the ServerDescription and AutoReconnect objects grows by 6301 in 63089 seconds , the frequency is consistent with the frequency of monitoring.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            xiaoliuhust@gmail.com 肖 刘
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: