Problem solve Get help with specific problems with your technologies, process and projects.

How to flush memory occupied by queries in different sessions

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.

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

Dig Deeper on Microsoft SQL Server Installation

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.