On my current project I've noticed that IE uses a quite a lot of memory. Spent some time of investigation i found out that images are not removed from memory, but my site uses images quite intesively.
Finally I've created a simple test that dynamically loads images and then clears it using jQuery
My test js:
$(document).ready(function () {
$('#appendImages').click(append);
$('#removeImages').click(remove);
});
function append() {
$.post("http://localhost/TestService/GetImages", { key: $('#key').val()}, function (data) {
$.each(data.Data.items, function (i, v) {
$('#imagesContainer').append('<img src="' + v.imageUrl + '" />');
}); ;
});
}
function remove() {
$('#imagesContainer').empty();
}
Test html:
<input id="key" type="text" value="jeans" >
<div id="reset">Reset</div>
<div id="repeatableReset">Repeatable Reset</div>
<div id="stop">Stop</div>
<br />
<br />
<br />
<br />
<div id="appendImages">append</div>
<div id="removeImages">remove</div>
<div id="imagesContainer"></div>
<html>
</html>
While appending new images the IE memory is incresing. But after I remove all loaded images the memory is not cleared. For example, right after page loading IE process uses 20MB, after appending images it uses 35MB, after clearing - 30MB.
I've used sIEve tool to find any leand but it displyed no leaks. Does IE cache somehow the images? Is there any issues in IE to handle dynamically created image elements?
Update In Firefox memory level remains constant, but in IE it is increasing.