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

Memory leak - using cursor function - fetchone

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Incomplete
    • 1.0.7
    • N/A
    • None
    • None

    Description

      It is reported by one of our customers, using the cursor functions: fetchone, observing the memory consumption and slowly leading to high memory usage, possible some sort of memory leak.

      Customer comments:
      Python version is - Python 3.6..
      Find attached small program we stripped out using the MariaDB library. The program almost double in size in ~ 48hrs and still growing.
      The pattern of growth is around 200K per hour. After the initial growth, it stays on the same size for 20-30min, then jump up by 90-100KB

      Attachments

        Issue Links

          Activity

            Locally am able to reproduce the case:

            MariaDB Connector/Python 1.0.7/1.0.10
            Python Version 3.6/3.8

            With the sample program shared, it does look like over a time, it consumes the memory.

            Python3.6

            PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
            31980 root 20 0 181828 17808 4672 S 0.3 0.0 0:16.06 python3
            ...
            31980 root 20 0 192080 27972 4672 S 0.0 0.1 0:37.22 python3 (executing from more than 4 days )

            Python3.8

            PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
            32083 root 20 0 173416 8604 4788 S 0.0 0.9 0:00.03 python3.8
            ...
            ...
            32083 root 20 0 180020 15292 4884 S 0.0 1.5 0:15.72 python3.8 (executing from more than 24hrs)

            Note:
            The sample program contains only once the cursor function fetchone is being used. But it is noted by the customer, deployed code include several of these function calls which makes memory usage to grow much faster.

            suresh.ramagiri@mariadb.com suresh ramagiri added a comment - Locally am able to reproduce the case: MariaDB Connector/Python 1.0.7/1.0.10 Python Version 3.6/3.8 With the sample program shared, it does look like over a time, it consumes the memory. Python3.6 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 31980 root 20 0 181828 17808 4672 S 0.3 0.0 0:16.06 python3 ... 31980 root 20 0 192080 27972 4672 S 0.0 0.1 0:37.22 python3 (executing from more than 4 days ) Python3.8 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 32083 root 20 0 173416 8604 4788 S 0.0 0.9 0:00.03 python3.8 ... ... 32083 root 20 0 180020 15292 4884 S 0.0 1.5 0:15.72 python3.8 (executing from more than 24hrs) Note: The sample program contains only once the cursor function fetchone is being used. But it is noted by the customer, deployed code include several of these function calls which makes memory usage to grow much faster.

            Thank you.

            julien.fritsch Julien Fritsch added a comment - Thank you.

            People

              georg Georg Richter
              suresh.ramagiri@mariadb.com suresh ramagiri
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.