Windows Vista Tips

Windows Vista Tips > Newsgroups > Internet Explorer > IE8 Leaks Memory When Images are Resized

Reply
Thread Tools Display Modes

IE8 Leaks Memory When Images are Resized

 
 
joshnaro
Guest
Posts: n/a

 
      04-29-2009
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.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/communities...plorer.general
 
Reply With Quote
 
 
 
 
joshnaro
Guest
Posts: n/a

 
      04-29-2009
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
>
>

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leaks? רועי Windows Vista Performance 7 12-29-2007 02:35 AM
Memory leaks Peter Ritchie [C# MVP] Internet Explorer 7 12-11-2007 01:29 AM
IE7 leaks memory with XML Dieter Hansch Internet Explorer 0 08-22-2007 08:52 AM
IE7 leaks memory!!! pablitobs Internet Explorer 0 11-27-2006 12:00 AM
IE7 Memory Leaks Haydn Robinson Internet Explorer 0 10-11-2006 10:14 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59