<p>I have a development vm which is running sql server as well as some other apps for my stack, and I found that the other apps are performing awfully.  After doing some digging, SQL Server was hogging the memory.  After a quick web search I discovered that by default, it will consume as much memory as it can in order to cache data and give it back to the system as other apps request it, but this process often doesn't happen fast enough, apparently my situation is a common problem.  </p>

<p><a href="http://blog.stevehorn.cc/2007/10/limit-memory-usage-in-sql-server-2005.html" rel="nofollow noreferrer">There however is a way to limit the memory SQL Server is allowed to have</a>.  My question is, how should I set this limit.  Obviously I'm going to need to do some guess and check, but is there an absolute minimum threshhold?  Any recommendations are appreciated.  </p>

<p>Edit:</p>

<p>I'll note that out developer machines have 2 gigs of memory so I'd like to be able to run the vm on 768 mb or less if possible.  This vm will be only used for local dev and testing , so the load will be very minimal.  After code has been tested locally it goes to another environment where the SQL server box is dedicated.  <strong>What I'm really looking for here is recommendations on minimums</strong></p>

[{'answer_id': 28402, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': 1, 'selected': False, 'text': '<blockquote>\n  <p>so id like to be able to run the vm on\n  768 mb or less if possible.</p>\n</blockquote>\n\n<p>That will depend on your data and the size of your database. But I usually like to give SQL server at least a GB</p>\n'}, {'answer_id': 28409, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 1, 'selected': False, 'text': '<p>It really depends on what else is going on on the machine.  Get things running under a typical load and have a look at Task Manager to see what you need for everything else.  Try that number to start with.</p>\n\n<p>For production machines, of course, it is best to give control of the machine to Sql Server (Processors -> Boost Sql Server Priority) and let it have all the RAM it wants.</p>\n\n<p>Since you are using VMs, maybe you could create a dedicated one just for Sql Server and run everything else on a different VM.</p>\n'}, {'answer_id': 28444, 'author': 'Tundey', 'author_id': 1453, 'author_profile': 'https://Stackoverflow.com/users/1453', 'pm_score': 2, 'selected': True, 'text': "<p>Since this is a development environment, I agree with Greg, just use trial and error. It's not that crucial to get it perfectly right.</p>\n\n<p>But if you do a lot of work in the VM, why not give it at least half of the 2GB?</p>\n"}, {'answer_id': 69553, 'author': 'Ricardo C', 'author_id': 232589, 'author_profile': 'https://Stackoverflow.com/users/232589', 'pm_score': 2, 'selected': False, 'text': '<p>Extracted fromt he SQL Server documentation: </p>\n\n<blockquote>\n  <p><strong>Maximum server memory (in MB)</strong></p>\n  \n  <p>Specifies the maximum amount of memory\n  SQL Server can allocate when it starts\n  and while it runs. This configuration\n  option can be set to a specific value\n  if you know there are multiple\n  applications running at the same time\n  as SQL Server and you want to\n  guarantee that these applications have\n  sufficient memory to run. If these\n  other applications, such as Web or\n  e-mail servers, request memory only as\n  needed, then do not set the option,\n  because SQL Server will release memory\n  to them as needed. <strong>However,\n  applications often use whatever memory\n  is available when they start and do\n  not request more if needed.</strong> If an\n  application that behaves in this\n  manner runs on the same computer at\n  the same time as SQL Server, set the\n  option to a value that guarantees that\n  the memory required by the application\n  is not allocated by SQL Server.</p>\n</blockquote>\n\n<p>The recommendation on minimum is: No such thing. The more memory the better. The SQL Sever needs as much memory as it can get or it will trash your IO.</p>\n\n<p>Stop the SQL Server. Run your other applications and take note to the amount of memory they need. Subtract that from your total available RAM, and use that number for the MAX memory setting in the SQL Server.</p>\n'}]
['https://Stackoverflow.com/questions/28387', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/292/']