Share via


Circular Memory Leak Mitigation

Windows Internet Explorer 8 improvements in memory management.

This topic contains the following sections.

  • Overview
  • Compatability: Changes in Behavior from Internet Explorer 7
  • Feature Details

Overview

Internet Explorer 8 includes improvements to memory management that mitigate memory leaks previously created by circular references between Microsoft JScript objects and Document Object Model (DOM) objects.

Compatability: Changes in Behavior from Internet Explorer 7

This feature may affect the behavior of Web pages that depend on garbage memory that existed in previous versions of Internet Explorer only as the result of a memory leak. In Internet Explorer 8, these pages reference unallocated memory and generate a fault.

This feature affects each Web site displayed in Internet Explorer 8 regardless of the site's chosen compatibility mode.

Feature Details

As described in detail in Understanding and Solving Internet Explorer Leak Patterns, the JScript garbage collector in previous versions of Windows Internet Explorer manages the lifetime of JScript objects but not of DOM objects. As a result, the JScript garbage collector cannot break circular references between DOM objects and JScript objects, and memory leaks occur. In Microsoft Internet Explorer 6, these circular references are broken when the Windows Internet Explorer process terminates. In Windows Internet Explorer 7, these circular references are broken when users navigate away from the page that contains the leaks.

In Internet Explorer 8, the JScript garbage collector treats DOM objects referenced by JScript objects as JScript objects. Rather than wait until page navigation as in Internet Explorer 7 or process termination as in Internet Explorer 6, the garbage collector manages the lifetime of these DOM objects and breaks circular references whenever possible throughout the lifetime of the site.

Although Web developers should be aware of memory leaks created by use of programming patterns such as JScript closures in Internet Explorer 7 and earlier, those patterns no longer result in leaks in Internet Explorer 8.