SQL Server Memory Woes
August 20, 2009
Consider this: a server with 8 GB of RAM, Windows 2003 64-bit, and SQL Server 2005 x64 had 100 MB available at its lowest point (600 MB at its highest), as revealed by performance monitoring. There was insignificant traffic on the application side to be using this much memory. The issue, in other words, was that SQL Server memory usage was increasing as time passed. So off we go to find out what’s going on.
The first thing to check was the setting for max memory. This server had a setting of 2147483648 MB. That’s way more than 8 GB available. It means that SQL Server would use all available memory until the OS told it to stop as there wasn’t any left (How to adjust memory usage by using configuration options in SQL Server). Following Suggested Max Memory Settings for SQL Server 2005/2008, max memory was set to 6700 MB (How to: Set a Fixed Amount of Memory (SQL Server Management Studio)).
select 'update statistics '+name from sys.tables order by name
Above query gives a nice list of tables in the database in a format ready to run. Just copy/paste the results of the query into Query Analyzer or Management Studio and run them. This will update statistics for all tables one by one, improving query execution plans. This query should be run periodically.
Since these changes were made recently, the results are not in. As soon as we know more, we will share with you if things improved.