SQL Server 2008占用大量内存?(SQL Server 2008 takes up a lot of memory?)

编程入门 行业动态 更新时间:2024-10-22 02:49:10
SQL Server 2008占用大量内存?(SQL Server 2008 takes up a lot of memory?)

我正在对我的数据库进行压力测试,该数据库托管在具有10 GB RAM的64位计算机上运行的SQL Server 2008 64位上。

我有400个线程。 每个线程每秒查询一次数据库,但查询时间并不耗时,正如SQL分析器所说的那样,但18小时后SQL Server使用了7.2 GB的RAM和7.2 GB的虚拟内存。

这是正常的行为吗? 如何调整SQL Server以清理未使用的内存?

I am conducting stress tests on my database, which is hosted on SQL Server 2008 64-bit running on a 64-bit machine with 10 GB of RAM.

I have 400 threads. Each thread queries the database every second, but the query time does not take time, as the SQL profiler says that, but after 18 hours SQL Server uses up 7.2 GB of RAM and 7.2 GB of virtual memory.

Is this normal behavior? How can I adjust SQL Server to clean up unused memory?

最满意答案

SQL Server被设计为使用尽可能多的内存,以便通过在内存中缓存大量内容来提高性能。 建议使用专用的SQL Server机器,这使得这是一个非常有效的方法,因为它不会期望别人需要内存。 所以你不应该担心这个; 这很正常。

也就是说,如果你使用的是开发机器而不是实时环境,那么你可能希望限制内存的数量来阻止你的盒子被占用。 在这种情况下,最简单的方法是打开SQL Server Management Studio,右键单击服务器并选择“属性”,然后在“内存”选项卡上可以设置最大服务器内存。

SQL Server is designed to use as much memory as it can get its hands on, to improve performance by caching loads of stuff in memory. The recommendation is to use dedicated machines for SQL Server, which makes this a perfectly valid approach, as it isn't expecting anybody else to need the memory. So you shouldn't worry about this; it's perfectly normal.

That said, if you're on a development machine rather than a live environment, you may wish to limit the amount of memory to stop your box being taken over. In this case the easiest ways is to open SQL Server Management Studio, right-click on the server and select "Properties", then on the "Memory" tab you can set the maximum server memory.

更多推荐

本文发布于:2023-04-29 02:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1334542.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内存   Server   SQL   lot   takes

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!