Skip to main content

Bug Tracker

Side navigation

#6527 closed bug (worksforme)

Opened May 05, 2010 01:40AM UTC

Closed November 19, 2010 11:30PM UTC

use replaceWith cause memory leak in IE (jquery 1.4.2)

Reported by: samchuang Owned by:
Priority: low Milestone: 1.4.4
Component: manipulation Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

in IE, use replaceWith cause memory leak in IE, if change to use "outerHTML" the memory leak will be less, but still has memory leak.

here is the test case:

<html>

<head>

<script type="text/javascript" charset="UTF-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>

</head>

<body>

<script>

count = 0;

function getHtml() {

var html = ['<div id="mytable"><table>'];

count++;

for (var i = 0; i < 20; i++) {

html.push('<tr>');

for (var j = 0; j < 6; j++)

html.push('<td>Test: ' + count + 'cell_' + i + '_' + j + '</td>');

html.push('</tr>');

}

html.push('</table></div>');

return html.join('');

}

function intervalRender() {

var id = window._intervalID;

if (!id) {

id = setInterval(function () {

jQuery('#mytable').replaceWith(getHtml());

}, 1000);

}

}

function leakLessMemory() {

var id = window._intervalID;

if (!id) {

id = setInterval(function () {

jQuery('#mytable')[0].outerHTML = getHtml();

}, 1000);

}

}

jQuery(document).ready(function() {

intervalRender();

//leakLessMemory();

});

</script>

<div id="mytable">

</div>

</body>

</html>

Attachments (1)
Change History (3)

Changed June 12, 2010 02:06AM UTC by dmethvin comment:1

component: unfiledmanipulation

Changed November 12, 2010 02:40AM UTC by snover comment:2

milestone: 1.4.3

Resetting milestone to future.

Changed November 19, 2010 11:30PM UTC by jitter comment:3

milestone: → 1.4.4
priority: → low
resolution: → worksforme
status: newclosed

test case doesn't leak any memory for me.

Can you confirm this testcase doesn't leak memory for you. Else report back with exact IE version and we might reopen the ticket.