Place the test code below (if it survives the post) in an .html file
alongside a list of large images named "TestImage0.jpg",
"TestImage1.jpg",..."TestImage9.jpg". The page will leak memory (I used sIEve
for testing) on every click of the page. If the resize css is removed, the
page will not leak.
Test Code
<html>
<head>
<title>Memory Leak Testing</title>
<script type="text/javascript">
var count = 0;
window.onload =
function() {
AppendImage();
window.document.body.onclick = ReplaceImage;
}
var ReplaceImage = function() {
window.document.body.removeChild(document.getEleme ntById('MemTestObject' +
count));
count++;
if (count > 9) {
alert('No more images to load.');
} else {
AppendImage();
}
}
var AppendImage = function() {
var imageObject = document.createElement('img');
imageObject.id = 'MemTestObject' + count;
imageObject.className = 'MemTestObject';
imageObject.src = 'TestImage' + count + '.jpg';
window.document.body.appendChild(imageObject);
}
</script>
<style type="text/css">
.MemTestObject {
width: 140px;
height: 178px;
}
</style>
</head>
<body>
<h1>Memory Leak Testing</h1>
</body>
</html>
"Kai Schaetzl" wrote:
> Joshnaro schrieb am Wed, 29 Apr 2009 08:31:01 -0700:
>
> > I ran a simple experiment that works as follows:
> > 1. Load a large image into the body element on window load.
> > 2. Add a click handler to the body that removes the image element and adds
> > another with a reference to a different large image.
> >
> > Clicking through 10 images in this scenario works fine. However, if the
> > image is resized (css or otherwise), IE8 leaks memory on every click. I used
> > sIEve for my memory watching.
>
> It would be helpful if you would provide a validated, sample URL where this can
> be reproduced.
>
> Kai
> --
> Helpsites about Windows: http://www.mvps.org
> IE repair script: http://iefaq.info
>
>