Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am running a stored procedure in query builder and closing query builder. However, the memory allocated doesn't get released. The stored procedure uses temp tables and drops them immediately after its use. These tables get created in a loop, get truncated, and dropped immediately. Any table that is created gets dropped immediately. The purpose of the stored procedure is only to make updates after a calculation using these temp tables.

After each execution, about 1.4 GB memory increases and never get released.

QUESTIONS

  1. What factors should be considered when creating temp tables in a stored procedure ?
  2. How can I claim memory after the stored procedure gets executed ?
share|improve this question
2  
Which database platform is this question for? –  SQLRockstar Dec 18 '13 at 15:30
    
SQL Server 2008 R2 –  Naresh Dec 18 '13 at 15:48

1 Answer 1

SQL Server doesn't release the memory it consumes unless it gets an order from the operating system to do so.

If you need, you can set the maximum amount of memory SQL Server will consume.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.