Ask the Expert

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.

    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

This was first published in April 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: