Memory is not released after the execution stored procedure followed by a process end 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

What factors should be considered when creating temp tables in a stored procedure ?
How can I claim memory after the stored procedure gets executed ?
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.