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

Doubled memory usage (11.4.4 <-> 11.4.5)

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.5
    • 11.4
    • None
    • None
    • Ubuntu 24.04
      Fedora 41

    Description

      Doubled memory usage (11.4.4 <-> 11.4.5)

      After updating a productive MariaDB installation to 11.4.5 my monitoring showed that the docker container for MariaDB (official image) is using twice as much memory than with the previous version (around 128MB with 11.4.4 and around 256 MB with 11.4.5).
      I checked my config and "SHOW GLOBAL STATUS", but nothing seems to explain that increase in memory usage. After rolling back to 11.4.4, everything is back to normal. This happened on Ubuntu 24.04 LTS (kernel 6.8.0-54-generic).

      I can even see a 30% increase with a blank database and default config on my Fedora 41 Workstation. When a client connects, in 11.4.5 the memory usage increases by 90MB (compared to 5MB in the previous version). With a client connected, you can see the 100% increase in memory usage.

      I also attached two screenshots showing memory and disk metrics of my production host around the time of downgrading MariaDB 11.4.5 to 11.4.4. It seems noticeable that 11.4.5 also causes higher disk I/O.

      # Check memory usage (use dedicated terminal to keep running)
      docker stats
       
      # Start containers
      docker run -d --name mariadb-11.4.4 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 mariadb:11.4.4
      docker run -d --name mariadb-11.4.5 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 mariadb:11.4.5
       
      # Connect a client
      docker exec -it mariadb-11.4.4 mariadb
      docker exec -it mariadb-11.4.5 mariadb
       
      # Stop containers and cleanup
      docker stop mariadb-11.4.4 mariadb-11.4.5
      docker rm mariadb-11.4.4 mariadb-11.4.5
      

      Attachments

        Issue Links

          Activity

            Can you try to obtain some more detailed memory usage statistics from MariaDB Server? For example, via the performance_schema? What is your workload like? Is this reproducible with some test workload that you can share with us?

            marko Marko Mäkelä added a comment - Can you try to obtain some more detailed memory usage statistics from MariaDB Server? For example, via the performance_schema ? What is your workload like? Is this reproducible with some test workload that you can share with us?
            mklocke Marius Klocke added a comment - - edited

            What I observed on my Fedora Workstation, was with a totally blank datadir and no workload at all. The increase in memory usage is visible while the database is idling. Did you run the Docker commands above?

            mklocke Marius Klocke added a comment - - edited What I observed on my Fedora Workstation, was with a totally blank datadir and no workload at all. The increase in memory usage is visible while the database is idling. Did you run the Docker commands above?
            alice Alice Sherepa added a comment -

            Caused by https://github.com/MariaDB/server/commit/7fcaab7aaa

            $ top -cb|grep mysqld
            1038163 a     20   0 1375148 222944  39316 S   0,0   0,7   0:01.18 /11.4/bld/sql//mysqld   (7fcaab7aaa)
             
            $ top -cb|grep mysqld
            1049414 a     20   0 1361792 134572  37828 S   0,0   0,4   0:00.21 /11.4/bld/sql//mysqld   (9e7762e718)
            

            alice Alice Sherepa added a comment - Caused by https://github.com/MariaDB/server/commit/7fcaab7aaa $ top -cb|grep mysqld 1038163 a 20 0 1375148 222944 39316 S 0,0 0,7 0:01.18 /11.4/bld/sql//mysqld (7fcaab7aaa)   $ top -cb|grep mysqld 1049414 a 20 0 1361792 134572 37828 S 0,0 0,4 0:00.21 /11.4/bld/sql//mysqld (9e7762e718)

            mysql_utf8mb4_0900_collation_definitions_add() allocates 88,716,968 bytes.

            CHARSET_INFO structures are just few Ks, everything else is various tables that are exactly the same in 1400 and 0900, there is no need to duplicate them.

            serg Sergei Golubchik added a comment - mysql_utf8mb4_0900_collation_definitions_add() allocates 88,716,968 bytes. CHARSET_INFO structures are just few Ks, everything else is various tables that are exactly the same in 1400 and 0900, there is no need to duplicate them.

            People

              monty Michael Widenius
              mklocke Marius Klocke
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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