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

On Open Suse Linux, Mariadb Server does not deallocate memory when it should

    XMLWordPrintable

Details

    • Bug
    • Status: Needs Feedback (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 10.5, 10.6
    • None
    • None

    Description

      Tested with 10.11.9-MariaDB-log on openSUSE Leap 15.6.

      I use the following global variables to make this possible:

      innodb_buffer_pool_size = 1073741824
      max_heap_table_size =  10737418240
      

      Create a schema and a table to test memory allocation and deallocation:

      drop schema if exists memtest; 
      create schema if not exists memtest; use memtest;
      CREATE TABLE `BIGMEMORY`(`col1` int(11) NOT NULL AUTO_INCREMENT,`col2` varchar(1024) DEFAULT NULL,PRIMARY KEY (`col1`)) ENGINE=MEMORY;
      

      Insert ROWS:

      insert into memtest.BIGMEMORY (col2) 
      select concat(md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand()),md5(rand())) 
      from seq_1_to_358400;
      

      View memory usage with top comand. Examples:

      top -b -n 1 -p $(pidof mariadbd) | tail -2
      top -b -n 1 -p $(pidof mysqld) | tail -2
      top -b -n 1 -p 21111 | tail -2
      

      Truncate or drop the table. This should deallocate memory used by instance.

      View memory usage with top command again.

      Attachments

        1. configure_mariadb_server_to_use_jemalloc_on_suse_linux.txt
          2 kB
          Edward Stoever
        2. jemalloc_for_mariadb_on_suse_linux.png
          38 kB
          Edward Stoever
        3. results_debian_mariadb_BIGMEMORY_test.png
          30 kB
          Edward Stoever
        4. results_suse_mariadb_BIGMEMORY_test_2.png
          32 kB
          Edward Stoever
        5. results_suse_mariadb_BIGMEMORY_test_3.png
          38 kB
          Edward Stoever
        6. suse-memory-deallocate-test.txt
          4 kB
          Edward Stoever

        Activity

          People

            Unassigned Unassigned
            edward Edward Stoever
            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.