Memory leak occurs when behaviors are dynamically removed

Article translations Article translations
Article ID: 309170 - View products that this article applies to.
This article was previously published under Q309170
This article has been archived. It is offered "as is" and will no longer be updated.
Important This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
Expand all | Collapse all

SYMPTOMS

When an attached or element behavior is dynamically added and then removed in an HTML page, memory is not deallocated.

CAUSE

This problem is caused by a synchronization issue between Microsoft Internet Explorer and the script engine.

RESOLUTION

To resolve this problem, obtain the latest service pack for Internet Explorer 6. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
328548 How to obtain the latest service pack for Internet Explorer 6

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.

File information

The English version of this fix has the file attributes (or later) 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 tool in Control Panel.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Internet Explorer 6 Service Pack 1.

The fix for the issue is already present in Internet Explorer 7 and Internet Explorer 8, however the fix needs to be enabled by setting the registry entry mentioned in the following section.

MORE INFORMATION

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

This fix is included in Internet Explorer 6 SP1, and in later versions of Internet Explorer as listed in the "Applies To" section. However, by default, it is disabled. To enable this fix, set the following registry value to a string value of "yes" or to a binary value of 1: 
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Cleanup HTCs
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
315014 BUG: Memory leak occurs when you remove behaviors
For this fix to take effect, the code must meet the following requirements:
  • The behavior must have only one script element, and all script (such as inline event handlers) in the .htc file must use the same language as the single script element.
  • The script element can use the SRC attribute with no limit in the code size in the referenced file. However, the size of the script file referenced in the src attribute or the script code in the script tags must be at least 512 bytes.
This fix is only for lightweight HTML Components (HTCs). Support for regular HTCs would require architectural changes in both Mshtml and Jscript that were not feasible. Possible workarounds for regular HTCs include:
  • Make the HTC a lightweight HTC.
  • Navigate the page to reclaim memory.

Properties

Article ID: 309170 - Last Review: February 27, 2014 - Revision: 8.0
APPLIES TO
  • Microsoft Internet Explorer 6.0
  • Windows Internet Explorer 7
  • Windows Internet Explorer 8
Keywords: 
kbnosurvey kbarchive kbautohotfix kbhotfixserver kbenv kbie600presp1fix kbprb kbqfe kbie600sp1fix KB309170

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