首页 > 代码库 > Memory Allocation in the MySQL Server
Memory Allocation in the MySQL Server
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 Allocation in the MySQL Server (sql Directory)
The basic logic to use:
All things that are used only for the duration of a query are allocated in THD::mem_root through sql_alloc() or thd->alloc() except:
-
Things that may grow, like string buffers of type String. See sql/sql_string.cc.
-
Large blocks of memory used in one state of the query that can be released early. These are things like sort buffers, range trees, etc.
-
Things in libraries that are outside of MySQL‘s control (like hash tables).
Things that are needed a longer time should be alllocated with my_malloc() or through another MEMROOT.
Memory Allocation in the MySQL Server
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。