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

per-thread memory usage statistics

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.0.1
    • None
    • None

    Description

      Per-thread memory usage statistics
      Base code and idea from comes from
      http://mysql.taobao.org/index.php/Patch_source_code#per-thread_memory_usage_statistics.

      User visiable changes:

      • information_schema.processlist has a new columns: MEMORY_USAGE
      • SHOW STATUS has a new variable: Memory_used.

      The idea is that we mark all memory that are thread specific with MY_THREAD_SPECIFIC.
      Memory counting is done per thread in the my_malloc_size_cb_func callback function from my_malloc().

      The following changes in interfaces was needed to get this to work:

      • init_alloc_root() amd init_sql_alloc() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
      • One now have to use alloc_root_set_min_malloc() to set min memory to be allocated by alloc_root()
      • my_init_dynamic_array() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
      • my_net_init() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
      • Added flag for hash_init() so that one can mark hash table to be thread specific.
      • Added flags to init_tree() so that one can mark tree to be thread specific.
      • Added flag to Warning_info::Warning_info() if the structure should be fully initialized.
      • String elements can now be marked as thread specific.

      Other things:

      • Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.