首页 > 数据库技术 > 详细

Memory Allocation in the MySQL Server

时间:2016-12-23 22:01:43      阅读:192      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/yuanjiangw/p/6216013.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!