Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36314

Memory usage on using Information Schema

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • None
    • N/A
    • Information Schema
    • None

    Description

      The server consumes memory on usage on Information schema.
      This server only contains MariaDB running on it.

      MariaDB [(none)]> system free -h
                     total        used        free      shared  buff/cache   available
      Mem:            15Gi       6.9Gi       361Mi       109Mi       8.3Gi       8.3Gi
      Swap:          487Mi        87Mi       400Mi
      MariaDB [(none)]> SELECT table_schema AS "name", SUM(data_length + index_length) AS "size", COUNT(table_name) as "tables" FROM information_schema.TABLES GROUP BY table_schema;
       
      +----------------------------------------------------+-----------+--------+
      | name                                               | size      | tables |
      +----------------------------------------------------+-----------+--------+
      | information_schema                                 |    212992 |     82 |
      | mysql                                              | 118759424 |     31 |
      | performance_schema                                 |         0 |     80 |
      | prod_2ertest_fr                                    | 135168000 |    456 |
      | prod_bageops_fr                                    | 121749504 |    466 |
      |***                                | 138428416 |    500 |
      +----------------------------------------------------+-----------+--------+
      53 rows in set (3.600 sec)
       
      MariaDB [(none)]>
      MariaDB [(none)]> system free -h
                     total        used        free      shared  buff/cache   available
      Mem:            15Gi       7.2Gi       153Mi       109Mi       8.2Gi       8.0Gi
      Swap:          487Mi        87Mi       400Mi
      MariaDB [(none)]>
      

      Attachments

        Activity

          jyotirajai Jyoti Rajai created issue -
          jyotirajai Jyoti Rajai added a comment -

          Memory usage by MariaDB on server:

            ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
              PID    PPID CMD                         %MEM %CPU
          1226932       1 /usr/sbin/mariadbd          47.0  3.3
          
          

          jyotirajai Jyoti Rajai added a comment - Memory usage by MariaDB on server: ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head PID PPID CMD %MEM %CPU 1226932 1 /usr/sbin/mariadbd 47.0 3.3
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Description The server consumes memory on usage on Information schema.
          This server only contains MariaDB running on it.

          ```


          MariaDB [(none)]> system free -h
                         total used free shared buff/cache available
          Mem: 15Gi 6.9Gi 361Mi 109Mi 8.3Gi 8.3Gi
          Swap: 487Mi 87Mi 400Mi
          MariaDB [(none)]> SELECT table_schema AS "name", SUM(data_length + index_length) AS "size", COUNT(table_name) as "tables" FROM information_schema.TABLES GROUP BY table_schema;

          +----------------------------------------------------+-----------+--------+
          | name | size | tables |
          +----------------------------------------------------+-----------+--------+
          | information_schema | 212992 | 82 |
          | mysql | 118759424 | 31 |
          | performance_schema | 0 | 80 |
          | prod_2ertest_fr | 135168000 | 456 |
          | prod_bageops_fr | 121749504 | 466 |
          |*** | 138428416 | 500 |
          +----------------------------------------------------+-----------+--------+
          53 rows in set (3.600 sec)

          MariaDB [(none)]>
          MariaDB [(none)]> system free -h
                         total used free shared buff/cache available
          Mem: 15Gi 7.2Gi 153Mi 109Mi 8.2Gi 8.0Gi
          Swap: 487Mi 87Mi 400Mi
          MariaDB [(none)]>
          ```

          The server consumes memory on usage on Information schema.
          This server only contains MariaDB running on it.

          {noformat}
          MariaDB [(none)]> system free -h
                         total used free shared buff/cache available
          Mem: 15Gi 6.9Gi 361Mi 109Mi 8.3Gi 8.3Gi
          Swap: 487Mi 87Mi 400Mi
          MariaDB [(none)]> SELECT table_schema AS "name", SUM(data_length + index_length) AS "size", COUNT(table_name) as "tables" FROM information_schema.TABLES GROUP BY table_schema;

          +----------------------------------------------------+-----------+--------+
          | name | size | tables |
          +----------------------------------------------------+-----------+--------+
          | information_schema | 212992 | 82 |
          | mysql | 118759424 | 31 |
          | performance_schema | 0 | 80 |
          | prod_2ertest_fr | 135168000 | 456 |
          | prod_bageops_fr | 121749504 | 466 |
          |*** | 138428416 | 500 |
          +----------------------------------------------------+-----------+--------+
          53 rows in set (3.600 sec)

          MariaDB [(none)]>
          MariaDB [(none)]> system free -h
                         total used free shared buff/cache available
          Mem: 15Gi 7.2Gi 153Mi 109Mi 8.2Gi 8.0Gi
          Swap: 487Mi 87Mi 400Mi
          MariaDB [(none)]>
          {noformat}
          serg Sergei Golubchik added a comment -

          This is expected. It needs to open all tables to calculate the result of your query and open tables aren't immediately closed, but go into the table cache, in case you'll need them again

          serg Sergei Golubchik added a comment - This is expected. It needs to open all tables to calculate the result of your query and open tables aren't immediately closed, but go into the table cache, in case you'll need them again
          serg Sergei Golubchik made changes -
          Component/s Information Schema [ 14413 ]
          Fix Version/s N/A [ 14700 ]
          Resolution Not a Bug [ 6 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            Unassigned Unassigned
            jyotirajai Jyoti Rajai
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.