Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-126

Memory leak on connection object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.4
    • Fix Version/s: 1.0.5
    • Component/s: Generic
    • Labels:
      None

      Description

      Found a small memory leak on mariadb connection object.

      import resource
      import mariadb as driver
      # import mysql.connector as driver
      from time import sleep
       
      connection_parameters = {
          'host': '10.0.0.2',
          'user': 'me',
          'password': '123123',
          'database': 'test'
      }
       
      while True:
          for i in range(200):
              db = driver.connect(**connection_parameters)
              db.close()
          usage = resource.getrusage(resource.RUSAGE_SELF)
          print(f'Mem: {usage[2]}')
          sleep(1)
      

      Just in a few iterations the memory usage report grows if mariadb is used.

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            lucianobarcaro Luciano Barcaro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration