Microsoft KB Archive/274741

= MSXML May Leak Memory in a Multithreaded Application =

Article ID: 274741

Article Last Modified on 10/7/2005

-

APPLIES TO


 * Microsoft XML Parser 2.0
 * Microsoft XML Parser 2.5
 * Microsoft XML Parser 2.6

-



This article was previously published under Q274741



SYMPTOMS
When you use Microsoft XML (MSXML) in a multithreaded application that passes Extensible Markup Language (XML) objects (such as nodes and documents) between application components, if the components are running on separate threads, the application may leak memory over time. This is indicated by a growth in private bytes in the process. To measure the private bytes of a process, use a program such Performance Monitor.

In Microsoft COM+ on Microsoft Windows 2000, this problem may also occur when you pass XML objects between components that are running on the same thread because of the marshaling that occurs between COM+ contexts.



CAUSE
This problem occurs because of a known issue with the Msxml.dll file (in MSXML versions 2.0 and 2.5) and the Msxml2.dll file (in MSXML 2.6).



RESOLUTION
To resolve this problem, obtain MSXML version 3.0 or later. To obtain the latest full release of the Microsoft XML parser technology, visit the following Microsoft Web site:

XML Developer Center

http://msdn.microsoft.com/xml

The latest full release contains the fixes that are referred to in this article. The latest full release also contains additional functionality.

If you must continue to use MSXML version 2.6 (with Msxml2.dll), the following fix is available.

NOTE: No hotfix is available for MSXML 2.0 or MSXML 2.5.

A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next MSXML service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:   Date          Version       Size             File name -  Sep-28-2000   8.0.6728.0    687,888 bytes    Msxml2.dll Sep-28-2000  8.0.6728.0     21,776 bytes    Msxml2a.dll Sep-28-2000  8.0.6728.0     37,648 bytes    Msxml2r.dll Sep-28-2000  8.0.6728.0     26,384 bytes    Xmlinst.exe To install and to run this hotfix, follow these steps:  Run the self-extracting .zip file that Microsoft Product Support Services provides. This file unzips the files to a location that you specify. Copy these files to your System32 directory, and replace these files if they already exist. This is assuming that you do not have MSXML 3.0 or later installed.

NOTE: If any application is using a copy of any of these .dll files, you must exit the application first. At a command prompt, make sure that System32 is the current directory, and then type the following command to register the Msxml2.dll file:

regsvr32 msxml2.dll

 If you want existing clients that previously used MSXML 2.0 (Msxml.dll) to use the new version without recompiling your application, type the following command at the command prompt:

xmlinst msxml2.dll





STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

<div class="references_section">