Buffer Pool--内存总结2
按内存划分:
1.DATABASE CACHE
用于存放数据页面的缓冲区,8KB每页
2.各项组件
A)数据库连接(CONNECTION)
B)通用数据,如果事务上下文,表和索引的元数据
C)执行计划(QUERY PLAN),语句和存储过程的执行计划
D)查询优化器(Optimizer)
E)Utilities,如BCP,Log Manager,Backup tools,parallel queries and so on
3.线程内存
Each thread use 0.5MB memory to store data structure and relative infomation
4.The third application apply memeory
like link server, sql mail, user defined CLR,Extended stored procedure,dirver ect
Divided by Apply method:
1.Reserved and committed memory, reserved first and then committed.
2.Stolen memory,commited without reserving memory.
SQL SERVER never use AWE for stolen memery
Divided by Page size:
1.Single page memory,the applied memory is equal or less then 8KB
2.Multiple page memory(MemToLeave), the applied memery is bigger than 8KB
the most part of memery in MemToLeave is not charged by SQL SERVER
SQL SERVER使用Memory Clerk来管理SQL SERVER内存的分配和回收,因此可以使用sys.dm_os_memory_clerks 来查看内存使用情况,注意sys.dm_os_memory_clerks反应的内存不包括第三方代码使用的内存。
SELECT M.type,
sum(M.virtual_memory_reserved_kb) AS VirtualMemoryReservedKB,
SUM(M.virtual_memory_committed_kb) AS VirtualMemortCommitedKB,
SUM(M.shared_memory_committed_kb) AS SharedMemroyCommittedKB,
SUM(M.shared_memory_reserved_kb) AS SharedMemroyReservedKB,
SUM(M.multi_pages_kb) AS MultiPagesKB,
SUM(M.single_pages_kb) AS SinglePagesKB,
SUM(M.multi_pages_kb)+SUM(M.single_pages_kb) AS TotalPagesKB
FROM sys.dm_os_memory_clerks M
GROUP BY M.type
ORDER BY TotalPagesKB DESC
查看表中数据在缓冲池中的信息
SELECT name AS TabelName,
index_id AS IndexId,
COUNT(*)AS CachedPageCount,
CAST(COUNT(*)*8.0/1024 AS INT) AS CachedMemoryMB
FROM sys.dm_os_buffer_descriptors AS bd
INNER JOIN
(
SELECT OBJECT_NAME(OBJECT_ID) AS name
,index_id ,allocation_unit_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.hobt_id
AND (au.type = 1 OR au.type = 3)
UNION ALL
SELECT OBJECT_NAME(OBJECT_ID) AS name
,index_id, allocation_unit_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.partition_id
AND au.type = 2
) AS obj
ON bd.allocation_unit_id = obj.allocation_unit_id
WHERE database_id = DB_ID()
GROUP BY name, index_id
ORDER BY CachedMemoryMB DESC;
Buffer Pool--内存总结2的更多相关文章
- 14.6.3.3 Making the Buffer Pool Scan Resistant
14.6.3.3 Making the Buffer Pool Scan Resistant 相比使用一个严格的LRU算法,InnoDB 使用一个技术来最小化数据总量 带入到buffer pool 而 ...
- 谁占用了我的Buffer Pool
原文:谁占用了我的Buffer Pool 转自:http://blogs.msdn.com/b/apgcdsd/archive/2011/01/11/buffer-pool.aspx 我在做SQL S ...
- MySQL · 引擎特性 · InnoDB Buffer Pool
前言 用户对数据库的最基本要求就是能高效的读取和存储数据,但是读写数据都涉及到与低速的设备交互,为了弥补两者之间的速度差异,所有数据库都有缓存池,用来管理相应的数据页,提高数据库的效率,当然也因为引入 ...
- 谁占用了我的Buffer Pool?--【转】
转自:http://blogs.msdn.com/b/apgcdsd/archive/2011/01/11/buffer-pool.aspx 我在做SQL Server 7.0技术支持的时候有客户问我 ...
- 查看Buffer Pool使用情况--[转]
----源自:微软官方博客论坛 我的SQL Server buffer pool很大,有办法知道是哪些对象吃掉我的buffer Pool内存么?比方说,能否知道是哪个数据库,哪个表,哪个index占用 ...
- InnoDB缓存---InnoDB Buffer Pool
InnoDB Buffer Pool 定义 对于InnoDB存储引擎,不管用户数据还是系统数据都是以页的形式存储在表空间进行管理的,其实都是存储在磁盘上的. 当InnoDB处理客户端请求,需要读取某页 ...
- 【大白话系统】MySQL 学习总结 之 缓冲池(Buffer Pool) 如何支撑高并发和动态调整
如果大家对我的 [大白话系列]MySQL 学习总结系列 感兴趣的话,可以点击关注一波. 一.上节回顾 在上节< 缓冲池(Buffer Pool) 的设计原理和管理机制>中,介绍了缓冲池整体 ...
- 【MySQL】InnoDB 内存管理机制 --- Buffer Pool
InnoDB Buffer Pool 是一块连续的内存,用来存储访问过的数据页面 innodb_buffer_pool_size 参数用来定义 innodb 的 buffer pool 的大小 是 M ...
- SQL Server 2014新特性探秘(2)-SSD Buffer Pool Extension
简介 SQL Server 2014中另一个非常好的功能是,可以将SSD虚拟成内存的一部分,来供SQL Server数据页缓冲区使用.通过使用SSD来扩展Buffer-Pool,可以使得大量随 ...
- 理解innodb buffer pool
今天组里有个同事说可以查看innodb buffer pool每个表和索引占的大小,为此我搜了下,还真有方法,记录下. innodb buffer pool有几个目的: 缓存数据--众所周知,这个占了 ...
随机推荐
- Keras函数式 API
用Keras定义网络模型有两种方式, Sequential 顺序模型 Keras 函数式 API模型 之前我们介绍了Sequential顺序模型,今天我们来接触一下 Keras 的函数式API模型. ...
- c#中变量的作用域
C#中的作用域和javascript中的作用域还是有区别的.呵呵 class Person { /* *确定C#变量作用域的2个规则. 1.类的字段所处的作用域等同于该字段所属类所在的作用域; * 2 ...
- Android TextView(EditView)文字底部或者中间 加横线
Android TextView(EditView)文字底部或者中间 加横线 tv = (TextView) this .findViewById(R.id. text_view ); 中间加横线 t ...
- word2vec相关
word '\xe8\xb6\x85\xe8\x87\xaa\xe7\x84\xb6\xe7\x8e\xb0\xe8\xb1\xa1' not in vocabulary 分词后的样本格式:英雄联盟, ...
- Poly
folly/Poly.h Poly is a class template that makes it relatively easy to define a type-erasing polymor ...
- SpringBoot 之 普通类获取Spring容器中的bean
[十]SpringBoot 之 普通类获取Spring容器中的bean 我们知道如果我们要在一个类使用spring提供的bean对象,我们需要把这个类注入到spring容器中,交给spring容器 ...
- js中的event
event代表事件的状态,例如触发event对象的元素.鼠标的位置及状态.按下的键等等.event对象只在事件发生的过程中才有效.event的某些属性只对特定的事件有意义.比如,fromElement ...
- 「小程序JAVA实战」小程序数据缓存API(54)
转自:https://idig8.com/2018/09/22/xiaochengxujavashizhanxiaochengxushujuhuancunapi52/ 刚开始写小程序的时候,用户信息我 ...
- 按键精灵对VBS的支持
VBSBegin…VBSEnd(VBS块)格式:VBSBegin...VBSEnd用途:可以在VBS块的区域内随意的书写VBS语法指令. 更多说明:由于彻底的转向VBS语言,会导致goto语句不能被兼 ...
- 迷你MVVM框架 avalonjs 1.3.2发布
时隔一个月,avalon的新版本终于出来了,本次更新带来强大的模块间通信机制,其他就往常一样FIX BUG. 在文本绑定里,IE会对流离于DOM树外的文本节点的data属性赋值报错,需要添加一层判定 ...