Bug Tracker

Opened 13 years ago

Closed 13 years ago

#6527 closed bug (worksforme)

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)

memoryleak.html (1018 bytes) - added by samchuang 13 years ago.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by samchuang

Attachment: memoryleak.html added

comment:1 Changed 13 years ago by dmethvin

Component: unfiledmanipulation

comment:2 Changed 13 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:3 Changed 13 years ago by jitter

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.

Note: See TracTickets for help on using tickets.