SQL 内存使用情况
我正在管理一个运行 IIS 和 SQL 08 Express 的同一位置的 winserver08 盒子。 我只是碰巧浏览了任务管理器的性能选项卡,发现“内存使用历史记录图表接近最高读数 1.8 GB(我有 2 GB 物理内存)”。 进程显示 sqlserver 的运行速度为 940,000K - 迄今为止最大的消耗者。
我是一个低容量站点 - CPU 利用率几乎没有记录。 服务器根本没有任何稳定性问题。 这就是 SQL 处理可用内存的方式还是我应该深入挖掘?
谢谢
I'm managing a co-located winserver08 box running both IIS and SQL 08 express. I just happened to glance at the task manager's performance tab and find the 'mem usage history graph is close to topped out reading 1.8 gig (i have 2 gig physical ram). Processes shows sqlserver is running at 940,000K - by far the largest consumer.
I'm a low volume site - cpu utilization barely registers. Haven't had any stability issues with the server at all. Is this just how SQL treats available mem or should I be digging deeper?
thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
SQL Server 管理它自己的内存池。 它会在内存压力下将内存释放回操作系统。
所以,是的,这是正常行为,无需担心。
注意:我应该提到一个例外:如果 TSQL 脚本使用 sp_OACreate 创建 COM 对象,并且没有使用相应的 sp_OSDestroy 释放该对象(例如,发生错误并且脚本提前终止) ,那么内存可能会泄漏。 这些存储过程的使用并不常见(许多 DBA 不允许打开此功能,这是有充分理由的)我相信对于未释放的游标也是如此。
SQL Server manages it's own memory pool. It will release memory back to the OS under memory pressure.
So, yes, this is normal behaviour and nothing to be concerned about.
Note: I should mention an exception to this: If TSQL scripts are using sp_OACreate to create COM objects and not releasing the object with a corresponding sp_OSDestroy (say, for instance an error occurs and the script terminates prematurely), then memory can leak. Use of these stored procedures is not that common (many DBAs won't allow this feature to be turned on, for good reason) I believe this is also the case for CURSORS that are not deallocated.
除非您已配置,否则这是正常行为。 阅读本文,清楚了解内存配置和建议。
就您的情况而言,我假设您使用默认设置,并且您看到的内容是正常的,无需担心。
拉吉
Unless you have configured this is normal behavior. Read this article for a clear understanding of memory configuration and recommendations.
In your case, I assume you have the default settings and what you see is normal and there is no cause for concern.
Raj
请记住,与任何标准版本(即任何非 Express 版本)相比,SqlExpress 可能以不同的方式管理内存。
我无法提供具体的链接,但从个人经验来看,当您转向正确的 SQLServer 发行版时,情况会发生很大变化(速度、内存管理、极端条件下的响应能力等)。
如果有人知道更多信息,请整合我的答案。
Keep into account SqlExpress probably manages memory in a different way compared to any standard edition (that is, any non-express edition).
I can't provide specific links but from personal experience things change a lot when you move to a proper distribution of SQLServer (speed, memory-manamgement, responsiveness in extreme conditions, etc).
If anybody knows something more please integrate my answer.
如果没有限制,SQL Server 将使用机器内存 90% 的区域。 这是完全正常的,因为 SQL Server 正在自行管理内存,并会根据需要释放内存。
如果您担心这个问题,您可以通过转到 sqlexpress 实例的属性,选择内存页,然后减少最大服务器内存来限制 SQL Server 可以使用的内存量。
SQL Server will use something in the area of 90% of a machine's memory if it isn't capped. This is completely normal as SQL Server is managing memory for itself and will release memory as necessary.
If you are worried about it than you can cap the amount of memory SQL Server can use, by going to the properties of the sqlexpress instance, selecting the memory page and then reducing the maximum server memory.