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)
Change History (4)
Changed 13 years ago by
Attachment: | memoryleak.html added |
---|
comment:1 Changed 13 years ago by
Component: | unfiled → manipulation |
---|
comment:2 Changed 13 years ago by
Milestone: | 1.4.3 |
---|
comment:3 Changed 13 years ago by
Milestone: | → 1.4.4 |
---|---|
Priority: | → low |
Resolution: | → worksforme |
Status: | new → closed |
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.
Resetting milestone to future.