Skip to content

Commit 3aa7a68

Browse files
committed
All versions of IE leak memory when removing DOM nodes
1 parent bc88c89 commit 3aa7a68

File tree

1 file changed

+3
-22
lines changed
  • SeleniumTester/src/test/java/org/loverde/jquery/restrictedtextfield/selenium/tests

1 file changed

+3
-22
lines changed

SeleniumTester/src/test/java/org/loverde/jquery/restrictedtextfield/selenium/tests/AbstractTest.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,14 +1064,7 @@ public AbstractTest( final FieldType fieldType,
10641064
throw new IllegalStateException( "IE driver is null" );
10651065
} else {
10661066
System.out.println( "Got IE driver" );
1067-
1068-
final Capabilities capabilities = ((RemoteWebDriver) driver).getCapabilities();
1069-
1070-
// IE 8 & 9 is garbage
1071-
1072-
if( "8".equals(capabilities.getVersion()) || "9".equals(capabilities.getVersion()) ) {
1073-
doPeriodicReload = true;
1074-
}
1067+
doPeriodicReload = true; // All versions of IE leak memory when nodes are removed from the DOM
10751068
}
10761069
} else if( clazz == FirefoxTest.class ) {
10771070
final String geckoPath = props.getProperty( APP_PROP_GECKO_DRIVER_PATH );
@@ -1166,22 +1159,10 @@ public void tearDown() throws Exception {
11661159
}
11671160

11681161
/**
1169-
* Quoting <a href="http://com.hemiola.com/2009/11/23/memory-leaks-in-ie8">http://com.hemiola.com/2009/11/23/memory-leaks-in-ie8</a>
1170-
* <em>
1171-
* <p>
1172-
* The memory used by IE8 to create certain DOM nodes is never freed, even if those DOM nodes are removed from the document (until window.top is unloaded).
1173-
* The DOM node types that leak are form, button, input, select, textarea, a, img, and object. Most node types don&apos; leak, such as span, div, p, table, etc.
1174-
* This problem only occurs in IE8 (and IE9 and IE10 preview). It does not occur in IE6, IE7, Firefox, or Chrome.
1175-
* </p>
1176-
* </em>
1177-
*
1178-
* <p>
1179-
* That's a problem for this application because it creates and destroys an input field hundreds of times. The <pre> used for log messages also leaks.
1180-
* This method periodically reloads the page to force a page refresh, and with it a release of memory leaked by Internet Explorer.
1181-
* </p>
1162+
* All versions of IE leak memory when removing nodes from the DOM. This method reloads the page to free it up.
11821163
*/
11831164
private void ieMemoryLeakFix() throws Exception {
1184-
log( "IE 8/9 leak prevention" );
1165+
log( "IE leak prevention" );
11851166
javascript( "window.location = window.location;" ); // Sending F5 reloads the page, but memory isn't freed
11861167
}
11871168

0 commit comments

Comments
 (0)