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的更多相关文章

  1. MySQL Server and Server-Startup Programs

    1. mysqld-The MySQL Server mysqld,also known as mysql server, is the main program that does most of ...

  2. Memory Allocation Error

    Memory allocation error happened when I tried to install MySQL 5.7.13 in my server, which has 2G mem ...

  3. linux 下tomcat出现 Native memory allocation (malloc) failed to allocate 1915224064 bytes for committing reserved memory问题

    ## There is insufficient memory for the Java Runtime Environment to continue.# Native memory allocat ...

  4. Linux下TomcatVM参数修改:Native memory allocation (mmap) failed to map 3221225472 bytes for committing reserved memory.

    不可行的方法最初我直接修改catalina.sh, 将JAVA_OPTS变量加上了 -server -Xms1G -Xmx1G -XX:+UserG1GC最初看起来没啥问题,但是当服务器运行几天后,发 ...

  5. MySQL Server类型之MySQL客户端工具的下载、安装和使用

    本博文的主要内容有 .MySQL Server 5.5系列的下载 .MySQL Server 5.5系列的安装 .MySQL Server 5.5系列的使用 .MySQL Server 5.5系列的卸 ...

  6. 第6章 影响 MySQL Server 性能的相关因素

    前言: 大部分人都一致认为一个数据库应用系统(这里的数据库应用系统概指所有使用数据库的系统)的性能瓶颈最容易出现在数据的操作方面,而数据库应用系统的大部分数据操作都是通过数据库管理软件所提供的相关接口 ...

  7. 影响 MySQL Server 性能的相关因素

    MySQL 最多的使用场景是WEB 应用,那么我们就以一个WEB 应用系统为例,逐个分析其系统构成,进行经验总结,分析出数据库应用系统中各个环境对性能的影响. 商业需求对性能的影响 这里我们就拿一个看 ...

  8. 配置percona mysql server 5.7基于gtid主主复制架构

    配置mysql基于gtid主主复制架构 环境: 操作系统 centos7. x86_64 mysql版本:Percona-Server-- 测试环境: node1 10.11.0.210 node2 ...

  9. MySQL mysql server与存储引擎

    mysql server系统架构 逻辑模块组成: mysql逻辑模块可以分为两层架构,第一层是sql layer主要包括权限判断.sql解析.执行计划优化.query cache的处理等:第二层是存储 ...

随机推荐

  1. laravel框架中注册信息验证

    .路由配置 <?php Route::. 控制器分配页面及验证表单提交内容 <?php .form 表单验证 {{ Form::open(array().slideUp();   < ...

  2. php短信发送

    <?php   ) {             );         curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_content);         cu ...

  3. ./configure会报错:pr command not found

    1.2    安装coreutils 请检查${MinGWDir}/msys/1.0/bin(默认为C:/MinGW/msys/1.0/bin)下有没有pr.exe,如果没有,那么在编译libav过程 ...

  4. struts2文件上传类型的过滤

    转自:http://www.2cto.com/kf/201403/282787.html 第一种解决方案: 1.手动实现文件过滤: 判断上传的文件是否在允许的范围内定义该Action允许上传的文件类型 ...

  5. matlab练习程序(多边形顶点凹凸性)

    生成简单多边形后,有时还需要对多边形各顶点的凹凸性做判断. 先计算待处理点与相邻点的两个向量,再计算两向量的叉乘,根据求得结果的正负可以判断凹凸性. 结果为负则为凹顶点,为正则为凸顶点. 凹顶点用o表 ...

  6. loj 1004(dp)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25830‘ 思路:类似与数塔问题,自底向上处理,输入的时候稍微注意一 ...

  7. javascript优化--01高质量编码

    javascript的浮点数: Javascript的数字都是双精度浮点数: 64位编码数字: 能表达53位精度的整数: 进行位运算时会隐式地转化为32位整数(0,1序列)后计算: 浮点数运算可能会有 ...

  8. Rightmost Digit

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission( ...

  9. 转 BHO API HOOK Wininet基于IE编程的一些资料

      BHO原理:推荐vc base中的文章: 如何使用BHO定制你的Internet Explorer浏览器 API HOOK的基本原理:推荐C++ builder 研究中的文章: API Hook基 ...

  10. WCF 采用net.tcp协议实践

    概述 与Socket相比,WCF真是爽得不得了,其基本指导思想为SOA——面向服务. 其基本配置在于ABC(Address,Binding,Contract),通常,只要这三个因素配置对了,那么,基本 ...