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

Memory leak on connection object

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.4
    • 1.0.5
    • Generic
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.