How can we flush memory that was occupied by different queries running in different sessions, because in SQL Server we find that if we close the session, it still occupies the server memory? I need some way to flush memory for different sessions. Awaiting your reply. Thanks in advance.
Requires Free Membership to View
There is no "flush" of server memory. The SQL Server will allocate memory for itself as it needs to, up to a maximum amount so as not to impact the operation of the OS. If no other process requires memory, then SQL Server will not release that memory back to the system and will appear to have blocked it all off. For example, if you have a machine with 512 MB of RAM on it and the OS needs 50MB to run, SQL Server can use up to 462 MB of RAM. If you have a series of queries that demand the utilization of 462 MB of RAM, then SQL Server will allocate that much memory to its processes. If no other process on the machine needs memeory, then your SQL Server memory allocation will remain at 462 MB indefinitely. If some other process executes that needs, say, 40 MB of RAM, then you will see the memory allocation for SQL Server drop by 40 MB to 422 MB.
For More Information
- What do you think about this answer? E-mail us at editor@searchDatabase.com with your feedback.
- The Best Microsoft SQL Server Web Links: tips, tutorials, scripts, and more.
- The Best SQL Web Links
- Have a SQL Server tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical SQL Server questions--or help out your peers by answering them--in our live discussion forums.
- Ask the Experts yourself: Our SQL Server gurus are waiting to answer your toughest questions.
This was first published in April 2001

Join the conversationComment
Share
Comments
Results
Contribute to the conversation