按内存划分:

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

  1. 14.6.3.3 Making the Buffer Pool Scan Resistant

    14.6.3.3 Making the Buffer Pool Scan Resistant 相比使用一个严格的LRU算法,InnoDB 使用一个技术来最小化数据总量 带入到buffer pool 而 ...

  2. 谁占用了我的Buffer Pool

    原文:谁占用了我的Buffer Pool 转自:http://blogs.msdn.com/b/apgcdsd/archive/2011/01/11/buffer-pool.aspx 我在做SQL S ...

  3. MySQL · 引擎特性 · InnoDB Buffer Pool

    前言 用户对数据库的最基本要求就是能高效的读取和存储数据,但是读写数据都涉及到与低速的设备交互,为了弥补两者之间的速度差异,所有数据库都有缓存池,用来管理相应的数据页,提高数据库的效率,当然也因为引入 ...

  4. 谁占用了我的Buffer Pool?--【转】

    转自:http://blogs.msdn.com/b/apgcdsd/archive/2011/01/11/buffer-pool.aspx 我在做SQL Server 7.0技术支持的时候有客户问我 ...

  5. 查看Buffer Pool使用情况--[转]

    ----源自:微软官方博客论坛 我的SQL Server buffer pool很大,有办法知道是哪些对象吃掉我的buffer Pool内存么?比方说,能否知道是哪个数据库,哪个表,哪个index占用 ...

  6. InnoDB缓存---InnoDB Buffer Pool

    InnoDB Buffer Pool 定义 对于InnoDB存储引擎,不管用户数据还是系统数据都是以页的形式存储在表空间进行管理的,其实都是存储在磁盘上的. 当InnoDB处理客户端请求,需要读取某页 ...

  7. 【大白话系统】MySQL 学习总结 之 缓冲池(Buffer Pool) 如何支撑高并发和动态调整

    如果大家对我的 [大白话系列]MySQL 学习总结系列 感兴趣的话,可以点击关注一波. 一.上节回顾 在上节< 缓冲池(Buffer Pool) 的设计原理和管理机制>中,介绍了缓冲池整体 ...

  8. 【MySQL】InnoDB 内存管理机制 --- Buffer Pool

    InnoDB Buffer Pool 是一块连续的内存,用来存储访问过的数据页面 innodb_buffer_pool_size 参数用来定义 innodb 的 buffer pool 的大小 是 M ...

  9. SQL Server 2014新特性探秘(2)-SSD Buffer Pool Extension

    简介     SQL Server 2014中另一个非常好的功能是,可以将SSD虚拟成内存的一部分,来供SQL Server数据页缓冲区使用.通过使用SSD来扩展Buffer-Pool,可以使得大量随 ...

  10. 理解innodb buffer pool

    今天组里有个同事说可以查看innodb buffer pool每个表和索引占的大小,为此我搜了下,还真有方法,记录下. innodb buffer pool有几个目的: 缓存数据--众所周知,这个占了 ...

随机推荐

  1. 整体读入cmd结果,而不是分行读入,效率极高

    public static long GetDirectorySize(string path) { long res = 0; System.Diagnostics.Process p = new ...

  2. SQL中like的用法

    操作符LIKE利用通配符把一个值与类似的值进行比较,通配符有两个: 1.百分号(%): 代表零个.一个或多个字符 2.下划线(_):代表一个数字或字符 下面的条件匹配任何以200开头的值 WHERE ...

  3. DrawGrid DrawFocusRect

    http://docwiki.embarcadero.com/CodeExamples/XE7/en/GridLineWidth_%28C%2B%2B%29 void __fastcall TForm ...

  4. TabIndex 属性 Tabindex="-1" 与Tabindex="0"、任意数字 (收录)

    TabIndex 属性 Tabindex="-1" 与Tabindex="0".任意数字 html中的tabIndex属性可以设置键盘中的TAB键在控件中的移动 ...

  5. gpg的使用

    [gpg的使用] 在Linux系统中,gpg程序可以实现非对称加密. 下面简单介绍gpg命令的用法:一.创建密钥:$ gpg --gen-key Please select what kind of ...

  6. Python3 min() 函数

    Python3 min() 函数  Python3 数字 描述 min() 方法返回给定参数的最小值,参数可以为序列. 语法 以下是 min() 方法的语法: min( x, y, z, .... ) ...

  7. 90. Subsets II (Back-Track, DP)

    Given a collection of integers that might contain duplicates, nums, return all possible subsets. Not ...

  8. Linux --centos7 开机启动设置

    以Linux下指定sun用户在linux开机时执行/home/sun/startrun.sh为例: 以root登录linux 执行vi /etc/rc.d/rc.local 在文档末尾添加一行语句:s ...

  9. 配置Linux防火墙

    配置防火墙(服务器安全优化)(转) 安全规划:开启 80  22 端口并 打开回路(回环地址 127.0.0.1) # iptables –P INPUT ACCEPT # iptables –P O ...

  10. [转]使用GetIfTable获取MIB_IFTABLE和MIB_IFROW获取网络接口信息

    #include <iphlpapi.h> #pragma comment ( lib, "iphlpapi.lib") 使用GetIfTable()获取各个端口信息的 ...