SQL Server uses more memory than "max server memory"
2014-10-09 13:19
417 查看
今天我遇到的一个现象就是虽然"max server memory"已经设置成了58.9G,但在windows task manager里面看到sqlservr.exe使用的内存已经达到了61G。
原因是
SQL Server will consume as much memory as you will allow it. By default, that number would encompass
100% of your numerical memory on your machine. That's why you're seeing what you're seeing. If you give SQL Server 24 GB of memory, then SQL Server will do its best to use 24 GB of memory. Then you have SQL Server and the OS battling for resources, and it'll
always result in poor performance.
When you set the
(2008 R2 and below),
也就是说"max server memory"限制的仅仅是buffer pool size而不是SQL Server使用的全部内存的上限。而SQL2008 R2之后的版本没有这个问题。因此2008R2及之前版本,我们没有办法设置SQL Server使用的总体内存的上限。当发现SQL Server占用过多内存导致OS内存不足时,唯一的办法就是重启SQL Server以释放内存。
原因是
SQL Server will consume as much memory as you will allow it. By default, that number would encompass
100% of your numerical memory on your machine. That's why you're seeing what you're seeing. If you give SQL Server 24 GB of memory, then SQL Server will do its best to use 24 GB of memory. Then you have SQL Server and the OS battling for resources, and it'll
always result in poor performance.
When you set the
max server memoryconfiguration limit, you are limiting how much SQL Server can allocate for the buffer pool (virtually where it stores data pages and the procedure cache). There are other memory clerks within SQL Server, so for your particular version
(2008 R2 and below),
max server memoryjust controls the buffer pool. But this is always going to be the biggest memory consumer.
也就是说"max server memory"限制的仅仅是buffer pool size而不是SQL Server使用的全部内存的上限。而SQL2008 R2之后的版本没有这个问题。因此2008R2及之前版本,我们没有办法设置SQL Server使用的总体内存的上限。当发现SQL Server占用过多内存导致OS内存不足时,唯一的办法就是重启SQL Server以释放内存。
相关文章推荐
- solution to hibernate in windows server 2003 sp1 with more than 1G memory
- 用Transact-Sql 怎么修改由sp_addlinkedserver创建的 "链接服务器"
- "Not associated with a trusted SQL Server connection"解决方法
- MS SQL Server错误21002:[SQL-DMO]用户"xxx"已经存在 解决方法
- ORA-04031: unable to allocate 4096 bytes of shared memory ("shared pool","BEGIN :EXEC_STR := SYS.DBMS...","PL/SQL MPCODE","BAMIM
- SQLServer "not in"
- SQL Server"错误 21002: [SQL-DMO]用户 * 已经存在问题解决
- 错误:"SQL Server Error:Table unknow tb_temp At line 1,column 30"之解决
- SQLServer "not in"
- 很怪异的asp问题,set rs=server.createobject("adodb.recordset")和set rs=conn.execute(sql)的区别
- 谈JDBC SQLSERVER"Error establishing socket"
- 如何修复SQLSERVER"置疑"之(二)
- Microsoft SQL Server 2000综合应用(2)——"配置服务器失败"解决方案
- SQLServer "not in"
- eclipse 连接 sqlserver2005错误信息:"java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver"
- MS SQL Server错误21002:[SQL-DMO]用户"xxx"已经存在
- 以前的某个程序安装在计算机上创建挂起文件操作,运SQL_server卸载了重装,往往是装不了.在安装SQL200的时候有个提示出现“以前的某个程序安装在计算机上创建挂起文件操作,运行安装程序之前必须重新启动计算机”,重起以后同样是这样..是什么原因阿?"后
- SQLServer "not in"
- 导入SQL导致"MySQL server has gone away"的解决方法
- com.microsoft.sqlserver.jdbc.SQLServerException: 此查询使用的不是 ANSI 外部联接运算符("*=" 或 "=*")。若要不进行修改即运行此查询,请使用存储过程 sp_dbcmptlevel 将当前数据库的