Question

I am trying to fix memory leaks in IE 7. Using Drip for investigations but it is not helping much when most dynamically generated DOM elements do not have unique ids.

Tips?

Was it helpful?

Solution

You should try the Javascript Memory Leak detector developed internally at Microsoft.

OTHER TIPS

Well, Your best bet is to understand what causes them, so you can look critically at your code, identify patterns that may cause a leak, and then avoid or refactor around them.

Here's a couple of links to get you started, both very informative:

Just remember that memory leaks are really about you not cleaning up after yourself. All you need is a little organization.

In the past, I have created my own proxy object for attaching events to DOM elements. It uses my javascript library's api to actually set and remove events. The proxy itself just keeps track of all of the references so that I can call a method on it to have it clean up all of my potential memory leaks.

For my purposes, I was able to just call a single deconstructor on the page that would clean up the leaks for the entire page when the user was leaving the page.

You may have to be more granular but the technique is the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top