Details

    • Type: Task
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Fix Version/s: 10.0.1
    • Component/s: None
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              serg Sergei Golubchik added a comment -

              pushed in 10.0-base

              Show
              serg Sergei Golubchik added a comment - pushed in 10.0-base

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  monty Michael Widenius
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved:

                    Time Tracking

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