Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-5525

TokuDB and MyRocks native partitioning never releases memory

    XMLWordPrintable

    Details

      Description

      Running sysbench with 6 threads and 20 tables structured like

      CREATE TABLE `sbtest11` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `k` int(10) unsigned NOT NULL DEFAULT '0',
        `c` char(120) NOT NULL DEFAULT '',
        `pad` char(60) NOT NULL DEFAULT '',
        PRIMARY KEY (`id`),
        KEY `k_1` (`k`)
      ) ENGINE=ROCKSDB DEFAULT CHARSET=utf8
      /*!50100 PARTITION BY RANGE (`id`)
      SUBPARTITION BY HASH (`id`)
      SUBPARTITIONS 5
      (PARTITION p0 VALUES LESS THAN (333333) ENGINE = ROCKSDB,
       PARTITION p1 VALUES LESS THAN (666666) ENGINE = ROCKSDB,
       PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ROCKSDB)
      

      with table_open_cache=10 and table_open_cache_instances=8 on 8 core machine eventually consumes all memory.  On 8.0 one can see a significant amount og memory being utilized by TABLE_SHARE::mem_root:

      mysql> select * from performance_schema.memory_summary_global_by_event_name where event_name ='memory/sql/TABLE_SHARE::mem_root'\G;
      *************************** 1. row ***************************
       EVENT_NAME: memory/sql/TABLE_SHARE::mem_root
       COUNT_ALLOC: 1065
       COUNT_FREE: 127
       SUM_NUMBER_OF_BYTES_ALLOC: 11783140772
       SUM_NUMBER_OF_BYTES_FREE: 507008
       LOW_COUNT_USED: 0
       CURRENT_COUNT_USED: 938
       HIGH_COUNT_USED: 938
       LOW_NUMBER_OF_BYTES_USED: 0
      CURRENT_NUMBER_OF_BYTES_USED: 11782633764
       HIGH_NUMBER_OF_BYTES_USED: 11782633764
      1 row in set (0.03 sec)

      In this ^^ example, we see 11Gb used here where the process VSZ is around 17Gb and about to trip OOM killer in this environment.

       

      In discussion w/ Satya Bodapati, we believe that the NP handlers are allocating memory off the wrong mem root, they should be using THD for transient open/close memory instead of the global TABLE_SHARE which is never released until the server is shut down.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                satya.bodapati Satya Bodapati
                Reporter:
                george.lorch George Lorch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d