FIX: A memory leak occurs when you call the Initialize method and the Terminate method of the SQLDistribution object in a loop in an application that you develop by using Microsoft ActiveX replication controls in SQL Server 2005

Article translations Article translations
Article ID: 940719 - View products that this article applies to.
Bug #: 50001535 (SQL Hotfix)
Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.
Expand all | Collapse all

On This Page

SUMMARY

This article describes the following about this hotfix release:
  • The issues that are fixed by the hotfix package
  • The prerequisites for installing the hotfix package
  • Whether you must restart the computer after you install the hotfix package
  • Whether the hotfix package is replaced by any other hotfix package
  • Whether you must make any registry changes
  • The files that are contained in the hotfix package

SYMPTOMS

When you run an application that you develop by using Microsoft ActiveX replication controls in SQL Server 2005, a memory leak occurs. This problem occurs when you call the Initialize method and the Terminate method of the SQLDistribution object in a loop in the application. If you use System Monitor (Perfmon.exe) to examine the Private Bytes counter of the Process object for the application instance, you find that the counter throughput keeps increasing.

For example, this issue may occur when you call the Initialize method and the Terminate method of the SQLDistribution object in code that resembles the following:
while (true)
{
	SQLDistribution_Object.Initialize();
	// Other calls. For example, you call some other methods of the SQLDistribution object here.
	SQLDistribution_Object.Terminate();
}

RESOLUTION

Cumulative update information

The fix for this issue was first released as a hotfix and is also available in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
941450 Cumulative update package 4 for SQL Server 2005 Service Pack 2
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 2005 fix release. Microsoft recommends 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:
937137 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 2 hotfix to an installation of SQL Server 2005 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

Service pack information

To resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must have SQL Server 2005 Service Pack 1 installed.

Restart information

You do not have to restart the computer after you apply this hotfix.

Registry information

You do not have to change the registry.

Hotfix file information

This hotfix contains only those files that are required to correct the issues that this article lists. This hotfix may not contain of all the files that you must have to fully update a product to the latest build.

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
SQL Server 2005 32-bit version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Bcp.exe2005.90.2237.069,48825-Jul-200721:54x86
Databasemailengine.dll9.0.2237.075,12025-Jul-200721:54x86
Logread.exe2005.90.2237.0400,75225-Jul-200721:56x86
Microsoft.analysisservices.adomdclient.dll9.0.2237.0546,16025-Jul-200721:56x86
Microsoft.analysisservices.deploymentengine.dll9.0.2237.0140,65625-Jul-200721:56x86
Microsoft.analysisservices.dll9.0.2237.01,217,90425-Jul-200721:56x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2237.078,19225-Jul-200721:56x86
Microsoft.sqlserver.sqlenum.dll9.0.2237.0910,70425-Jul-200721:56x86
Msasxpress.dll9.0.2237.024,94425-Jul-200721:56x86
Msgprox.dll2005.90.2237.0200,56025-Jul-200721:56x86
Msmdlocal.dll9.0.2237.015,647,08825-Jul-200721:56x86
Msmdredir.dll9.0.2237.03,993,96825-Jul-200721:56x86
Mssqlsystemresource.ldfNot applicable524,28825-Jul-200716:29Not applicable
Mssqlsystemresource.mdfNot applicable40,108,03225-Jul-200716:29Not applicable
Odsole70.dll2005.90.2237.059,76025-Jul-200721:56x86
Qrdrsvc.exe2005.90.2237.0369,52025-Jul-200721:56x86
Rdistcom.dll2005.90.2237.0643,44025-Jul-200721:56x86
Repldp.dll2005.90.2237.0187,24825-Jul-200721:56x86
Replmerg.exe2005.90.2237.0320,88025-Jul-200721:56x86
Replprov.dll2005.90.2237.0550,25625-Jul-200721:56x86
Replrec.dll2005.90.2237.0784,75225-Jul-200721:56x86
Replsub.dll2005.90.2237.0407,40825-Jul-200721:56x86
Spresolv.dll2005.90.2237.0177,00825-Jul-200721:57x86
Sqlaccess.dll2005.90.2237.0350,57625-Jul-200721:57x86
Sqlagent90.exe2005.90.2237.0321,39225-Jul-200721:57x86
Sqlservr.exe2005.90.2237.028,978,08825-Jul-200721:57x86
Sqsrvres.dll2005.90.2237.066,41625-Jul-200721:57x86
Sysdbupg.sqlNot applicable218,48606-Jul-200716:39Not applicable
Xmlsub.dll2005.90.2237.0195,44025-Jul-200721:57x86
Xpstar90.dll2005.90.2237.0295,28025-Jul-200721:57x86
Xpstar90.rll2005.90.2237.0155,50425-Jul-200721:56x86
SQL Server 2005 x64-based version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Bcp.exe2005.90.2237.088,94425-Jul-200721:26x64
Databasemailengine.dll9.0.2237.075,12025-Jul-200721:26x86
Logread.exe2005.90.2237.0525,16825-Jul-200721:26x64
Microsoft.analysisservices.adomdclient.dll9.0.2237.0546,16025-Jul-200721:26x86
Microsoft.analysisservices.adomdclient.dll9.0.2237.0546,16025-Jul-200721:56x86
Microsoft.analysisservices.deploymentengine.dll9.0.2237.0140,65625-Jul-200721:56x86
Microsoft.analysisservices.dll9.0.2237.01,217,90425-Jul-200721:56x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2237.094,06425-Jul-200721:26x64
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2237.078,19225-Jul-200721:56x86
Microsoft.sqlserver.sqlenum.dll9.0.2237.0877,93625-Jul-200721:26x86
Msasxpress.dll9.0.2237.030,06425-Jul-200721:26x64
Msasxpress.dll9.0.2237.024,94425-Jul-200721:56x86
Msgprox.dll2005.90.2237.0262,00025-Jul-200721:26x64
Msmdlocal.dll9.0.2237.015,647,08825-Jul-200721:56x86
Msmdredir.dll9.0.2237.03,993,96825-Jul-200721:56x86
Mssqlsystemresource.ldfNot applicable524,28825-Jul-200716:29Not applicable
Mssqlsystemresource.mdfNot applicable40,108,03225-Jul-200716:29Not applicable
Odsole70.dll2005.90.2237.090,99225-Jul-200721:27x64
Qrdrsvc.exe2005.90.2237.0434,03225-Jul-200721:27x64
Rdistcom.dll2005.90.2237.0836,97625-Jul-200721:27x64
Repldp.dll2005.90.2237.0237,93625-Jul-200721:27x64
Repldp.dll2005.90.2237.0187,24825-Jul-200721:56x86
Replmerg.exe2005.90.2237.0417,64825-Jul-200721:27x64
Replprov.dll2005.90.2237.0747,88825-Jul-200721:27x64
Replrec.dll2005.90.2237.01,010,54425-Jul-200721:27x64
Replsub.dll2005.90.2237.0528,24025-Jul-200721:27x64
Spresolv.dll2005.90.2237.0225,64825-Jul-200721:27x64
Sqlaccess.dll2005.90.2237.0357,74425-Jul-200721:27x86
Sqlagent90.exe2005.90.2237.0392,56025-Jul-200721:27x64
Sqlservr.exe2005.90.2237.039,361,90425-Jul-200721:27x64
Sqsrvres.dll2005.90.2237.078,19225-Jul-200721:27x64
Sysdbupg.sqlNot applicable218,48606-Jul-200716:39Not applicable
Xmlsub.dll2005.90.2237.0319,85625-Jul-200721:27x64
Xpstar90.dll2005.90.2237.0543,60025-Jul-200721:27x64
Xpstar90.rll2005.90.2237.0156,01625-Jul-200721:27x64
SQL Server 2005 Itanium architecture version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Bcp.exe2005.90.2237.0157,55227-Jul-200711:06IA-64
Databasemailengine.dll9.0.2237.075,12027-Jul-200711:06x86
Logread.exe2005.90.2237.01,098,09627-Jul-200711:06IA-64
Microsoft.analysisservices.adomdclient.dll9.0.2237.0546,16025-Jul-200721:56x86
Microsoft.analysisservices.adomdclient.dll9.0.2237.0546,16027-Jul-200711:06x86
Microsoft.analysisservices.deploymentengine.dll9.0.2237.0140,65625-Jul-200721:56x86
Microsoft.analysisservices.dll9.0.2237.01,217,90425-Jul-200721:56x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2237.078,19225-Jul-200721:56x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2237.0165,74427-Jul-200711:06IA-64
Microsoft.sqlserver.sqlenum.dll9.0.2237.0877,93627-Jul-200711:06x86
Msasxpress.dll9.0.2237.024,94425-Jul-200721:56x86
Msasxpress.dll9.0.2237.057,71227-Jul-200711:06IA-64
Msgprox.dll2005.90.2237.0545,13627-Jul-200711:06IA-64
Msmdlocal.dll9.0.2237.048,724,84827-Jul-200711:06IA-64
Msmdredir.dll9.0.2237.06,249,32827-Jul-200711:06IA-64
Mssqlsystemresource.ldfNot applicable524,28825-Jul-200716:29Not applicable
Mssqlsystemresource.mdfNot applicable40,108,03225-Jul-200716:29Not applicable
Odsole70.dll2005.90.2237.0180,08027-Jul-200711:06IA-64
Qrdrsvc.exe2005.90.2237.0943,98427-Jul-200711:06IA-64
Rdistcom.dll2005.90.2237.01,884,01627-Jul-200711:06IA-64
Repldp.dll2005.90.2237.0187,24825-Jul-200721:56x86
Repldp.dll2005.90.2237.0511,34427-Jul-200711:06IA-64
Replmerg.exe2005.90.2237.0957,29627-Jul-200711:06IA-64
Replprov.dll2005.90.2237.01,619,82427-Jul-200711:06IA-64
Replrec.dll2005.90.2237.02,143,60027-Jul-200711:06IA-64
Replsub.dll2005.90.2237.01,159,53627-Jul-200711:06IA-64
Spresolv.dll2005.90.2237.0498,03227-Jul-200711:06IA-64
Sqlaccess.dll2005.90.2237.0352,11227-Jul-200711:06x86
Sqlagent90.exe2005.90.2237.01,143,66427-Jul-200711:06IA-64
Sqlservr.exe2005.90.2237.072,548,20827-Jul-200711:00IA-64
Sqsrvres.dll2005.90.2237.0137,07227-Jul-200711:00IA-64
Sysdbupg.sqlNot applicable218,48606-Jul-200716:39Not applicable
Xmlsub.dll2005.90.2237.0593,26427-Jul-200711:00IA-64
Xpstar90.dll2005.90.2237.0953,71227-Jul-200711:00IA-64
Xpstar90.rll2005.90.2237.0154,99227-Jul-200711:06IA-64

WORKAROUND

To work around this issue, call the Initialize method and the Terminate method outside the loop. For example, see the following code:
SQLDistribution_Object.Initialize();
while (true)
{
	// Other calls. For example, you call some other methods of the SQLDistribution object here.
}
SQLDistribution_Object.Terminate();

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in SQL Server 2005 Service Pack 2.

MORE INFORMATION

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

REFERENCES

For more information about the list of builds that are available after SQL Server Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
937137 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
For more information about the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about how to obtain SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005
For more information about the new features and the improvements in SQL Server 2005 Service Pack 2, visit the following Microsoft Web site:
http://go.microsoft.com/fwlink/?LinkId=71711
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499 New naming schema for Microsoft SQL Server software update packages

Properties

Article ID: 940719 - Last Review: October 8, 2011 - Revision: 3.0
APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
Keywords: 
kbautohotfix kbsql2005sp2fix kbsql2005repl kbexpertiseadvanced kbfix kbqfe kbHotfixServer KB940719

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com