Memory Allocation in the MySQL Server

Source: Internet
Author: User

Https://dev.mysql.com/doc/internals/en/memory-allocation-mysql-server.html

MySQL Internals manual/memory allocation/memory Allocation in the MySQL Server (SQL Directory) 9.1 Memory Allocatio N in the MySQL Server (SQL Directory)

The basic logic to use:

All things that is used only for the duration of a query is allocated in Thd::mem_root through Sql_alloc () or Thd->al LOC () except:

    • Things. Grow, like string buffers of type string. See sql/sql_string.cc.

    • Large blocks of memory used in one state of the the query that can be released early. These is things like sort buffers, range trees, etc.

    • Things in libraries is outside of MySQL ' s control (like hash tables).

Things that is needed a longer time should be alllocated with My_malloc () or through another memroot.

Memory Allocation in the MySQL Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.