按内存划分:

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. jQuery layer弹出层插件 http://layer.layui.com/直接上官网学

    在许多网站中,经常用到弹出层,有时候为了达到更好的用户体验,你将写繁琐的css跟js,这款 jquery-layer可以让你想到即可做到的web弹窗/层js组件.layer侧重于用户灵活的自定义,为不 ...

  2. windows拖动文件到Ubuntu

    只需要安装 sudo apt install lrzsz

  3. php在线编辑本地文件方法共享

    public function testfile() { $cfile='F:\phpStudy\WWW\thinkphp5practise\NNWinLoseConfig.ini'; $cfileh ...

  4. python类静态变量

    python的类静态变量直接定义在类中即可,不需要修饰符,如: 1 class Test: stc_attr = 1 def __init__(self,attr1,attr2): self.attr ...

  5. C# 使用printDocument1.Print打印时不显示 正在打印对话框(里面还有一个讨厌的取消按钮)

    C#使用printDocument1.Print打印时不显示正在打印对话框有两种方法 第一种,使用PrintController PrintController printController = n ...

  6. DevExpress之XtraReport 学习

    XtraReport 一.基本概念: XtraReports 中的每个报表都由 XtraRepot 类的一个实例表示,或者由该类的子类来表示(这种情况更常见). 因此,每个报表都作为带区的容器使用,而 ...

  7. WSAEvent

    [WSAEvent] 1.WSACreateEvent.创建WSA事件. 2.WSAEventSelect. lNetworkEvents [in] A bitmask that specifies ...

  8. Inclusion–exclusion principle(动态规划)

    QUESTION: 把(2, 3, 5, 7)称为primes,能被primes整除的我们称之为Walprimes,比如 -21, -30, 0, 5, 14 是, 而-121, 1, 143 etc ...

  9. AnimationState

    1.1 AnimationClip AnimationClip是Unity3D中播放动画的最基本对象,通过FBX导入的各个动画对象其实就是一个AnimationClip.这个类已关键帧的形式记录了骨骼 ...

  10. golang语言基础(一)

    0.项目的组织结构: GOPATH路径下是src文件夹---->src文件夹下是项目名称---->项目名称下是该项目的各个包名---->各包名下是.go文件(一个包下,无论有多少个. ...