Skip to content
This repository

Memory Leak in IE7/XP #2300

Open
BooYaKaSha opened this Issue February 16, 2012 · 11 comments

7 participants

BooYaKaSha Olmo Maldonado Kai Gülzau Michael Cristian Carlesso xtophersd Garrick Cheung
BooYaKaSha

Unless there's something wonky about my setup, there seems to be a pretty serious memory leak when I do anything with the 1.4.x branch in IE7.

I'm running IE7 on XP SP3 with the latest patches in VirtualBox. The problem occurs even when running in "Safe Mode".

When I include an older version of the library, (i.e. 1.3.x), and create a new HTML file and simply put something like this in the body:

<script>
new Element('div');
</script>

When I open IE7 and keep the task manager visible, I can refresh over and over again and nothing happens -- on my setup memory use hovers around 35-36MB after several dozen refreshes.

However when I replace the library with anything from the 1.4.x branch (I've tried all of them including the nightly build),
when I do the same thing -- go the page in IE7 with task manager open -- with each refresh the memory usage climbs. It doesn't take long before it tops 100MB. Eventually I need to kill IE via the task manager because it stops responding.


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

Olmo Maldonado
Owner
BooYaKaSha

I have tried them, as a matter of fact.

I first noticed the issue on 1.4.4. I've previously tried 1.4.2, the Google-hosted 1.4.1, and the nightly build 1.4.5dev.

I'm a bit of a noob in this regard -- if I were to build from master, would that differ from the above versions (including nightly)?

Olmo Maldonado
Owner

Nightly is latest from master, but built at midnight (or so). If you're still seeing a leak, we'll have to investigate.

BooYaKaSha

As of right now I'm definitely still seeing the leak on my end using the latest nightly.

I'm testing with a document that's pretty much empty -- just a doctype, head/body/title elements, the core script include, and then in my body I have the single line of code I included from above.

The XP install I'm using is pretty much out of the box -- I haven't installed any other apps or add-ons -- I actually just set it up about 2 weeks ago. And I'm also testing this in IE7's safe mode as well. I have installed all of the Windows Updates (except IE8 obviously, and WMP11).

With the above configuration, each refresh ups IE's memory usage by about 2-3MB.

But once I replace the script include with something from the 1.3 branch, the memory stops rising and holds steady. Then when I revert back to the nightly and start refreshing again it resumes.

The only thing I'm wondering is if this could be somehow specific to VM's -- VirtualBox in particular. Because I've read other bug reports for the 1.4 branch from people using VirtualBox, and in some cases you guys weren't able to reproduce it. Unfortunately I don't have access to a native install though. But I don't really know how/why that would be related.

Kai Gülzau

Does the 1.3 branch include the Browser Module?
Perhaps its the Flash detection via ActiveXObject? see #2327

Kai Gülzau

This is reproduceable on my (VMWare) machine:

OS: Windows XP (SP2)
Browser: IE 7.0.5730.13
Moo: 1.4.5 / trunk

Here is another way to trigger the leak:

<!DOCTYPE HTML>
<html>
  <head>
    <script src="mootools.js" type="text/javascript"></script>
    <script type="text/javascript">
    function delBody() {
        var o = document.id('content');
        document.id(document.body).set('html', '');
    }
    setTimeout(delBody, 100);
    </script>
  </head>
  <body>
    <div id="content">myContent</div>
  </body>
</html>

The leak is gone when commenting out the IE7 _fireEvent wrapper:

https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.js#L270-273

or resetting _fireEvent manually via el._fireEvent = null;

So the leak seems to exist since 1.4.2.

Michael

Does anyone know if the fix for this made it into 1.4.5 as that is the milestone it seems to be attached to?

Cristian Carlesso
Collaborator

@michaelcm, take a look at this: #2351

xtophersd

I just grabbed the regular download for 1.4.5 from mootools/net/download.
OS XP, SP3, IE 7 (7.0.5730.13).

I recreated the example page the original poster described:
http://dev.specialtyproduce.com/fmb/foo.php

If you open up task manager, fire up IE7 and load the the page. On every reload memory increased.
On some of my more complicated pages and after cruising my dev site, IE 7 just closed outright.
It is still a problem.

Olmo Maldonado
Owner

As much as I'd like to have this done prior to 1.5, I'd like for someone smarter than me to come up with a automated memory leak testing -- or someone brave to weather through this storm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.