title: SQL Server not releasing memory after query executes
body: <p>I think I have a basic question here that many might have encountered. When I run a query in SQL Server it will load in memory all the data it needs for query execution (for example, if there is a join then it would load the necessary data from those two tables) but when the query finishes executing the memory consumed by SQL Server is not released. </p>
  
  <p>I noticed this because a few days back I was analyzing a query that takes up a lot of <code>tempdb</code> space. When I used to run the query it would (by the end of execution) consume upto 25 GB of RAM. This 25 GB RAM would not be released unless I restarted the <code>MSSQLSERVER</code> service.</p>
  
  <p>How do you guys do SQL Server memory management? This is clearly an issue right?</p>
  
  <p>I would also like to hear if you do something specific to clear the memory used up by a single query.</p>
  
  <p>Thanks in advance!</p>