You have a stored procedure that contains a child stored procedure in Microsoft SQL Server 2012.
The child stored procedure uses a table as a parameter.
You create a temporary table, and then you pass it to the child stored procedure as the parameter.
The child stored procedure runs some queries against the temporary table by using cursors.
In this scenario, a memory leak that degrades the performance of SQL Server 2012 occurs.
Cumulative update information
Cumulative Update 3 for SQL Server 2012 Service Pack 1 (SP1)
The fix for this issue was first released in Cumulative Update 3. For more information about how to obtain this cumulative update package for SQL Server 2012 SP 1, click the following article number to view the article in the Microsoft Knowledge Base:
2812412 Cumulative update package 3 for SQL Server 2012 Service Pack 1
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP 1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2772858 The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was released
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
The following table provides more information about the products or tools that automatically check for the condition that is described in the "Symptoms" section in your instance of SQL Server and in the versions of SQL Server against which the rule is evaluated:
Product versions against which the rule is evaluated
System Center Advisor
SQL Server Memory leak when queries are run against a temporary table in a nested stored procedure in SQL Server 2012
In this SQL Server instance advisor detected the presence of a SQL Server build lower than the fixed build for a Memory Leak issue. This can happen when you have a stored procedure that contains a child-stored procedure, which uses temp tables that further uses cursors. You may notice MEMORYCLERK_SQLOPTIMIZER of sys.dm_os_memory_clerks and MEMOBJ_EXECCOMPILETEMP from sys.dm_os_memory_objects going very high.