Slashdot Mirror


Plugging Internet Explorer's Leaks

jgwebber writes "If you're developing DHTML web apps, you probably already know first-hand that Internet Explorer has horrendous memory leak issues. You can't not run on IE, so you've got to find a way to plug those leaks. So I've created a tool to help you find them. So until Microsoft decides to fix its browser architecture (ha!), at least we can keep it from blowing huge amounts of memory."

4 of 480 comments (clear)

  1. Quick and dirty fix by Anonymous Coward · · Score: 3, Informative

    1. Open a new tab. Type "about:config" without quotes into the address bar and hit enter/click Go.

    2. Right-click anywhere, select New, then Integer. In the dialog prompt that appears, type:

    browser.cache.memory.capacity

    3. Click OK. Another dialog prompt will appear. This is where you decide how much memory to allocate to Firefox. This depends on how much RAM your computer has, but generally you don't want to allocate too little (under 8MB), but if you allocate too much, you might as well not do this. A good recommended setting is 16MB. If you want 16MB, enter this value into the dialog prompt:

    16384

    (Why 16384 instead of 16000? Because computers use base-12 counting. Thus 16 megabytes = 16384 bytes. Likewise, if you want to double that and allocate 32MB, you'd enter 32768.)

    4. Click OK to close the dialog box, then close all instances of Firefox and restart. If your Firefox still uses the same amount of memory, give it a few minutes and it should slowly clear up. If that fails, try a system reboot.

  2. Firefox Sucks (Memory) by lseltzer · · Score: 3, Informative

    >>It's laughable to mock IE for memory leaks when Firefox is X (where X > 1) times worse at sucking up and retaining memory.

    Thanks, I'm glad someone pointed this out. My system has been up for many days now and IE and Firefox are both consuming about the same amount (90-something MB).

  3. Re:RTFA by jhurshman · · Score: 3, Informative

    Not exactly.

    It detects memory leaks that are due to the two separate garbage collection routines that IE employs for DOM objects on the one hand, and JavaScript objects on the other. The leaks occur when a developer creates a circular reference between a JavaScript object and a DOM object, which is a very easy and natural thing to do.

    For example, this creates a memory leak in IE:

    someNode.onmouseover = function() { this.style.color = "#f00" };

    That is "poor" code only in the sense that it trips over IE's DOM/JS circular reference memory leak problem. Other browsers (e.g., Firefox 1.0.4, Safari 1.3+) handle that code with no memory leaks.

    So while it may be true that it is possible to write a web page that will cause a given web browser to leak memory, this DOM/JS problem is particularly evil because it occurs not with some obscure, complex, or malicious coding practice, but with one that is very common and natural.

    --

    Do not speak unless you can improve on the silence.
  4. great idea by Trailer+Trash · · Score: 3, Informative

    But your inflammatory tone would be really cool if our open source alternative in Firefox were somehow better. Right now, Firefox is using 373M on my computer (334M resident) with three windows open, none of which have anything bigger than this /. page. Mozilla is using 279M (I'm also running it) with a single page open. Firefox usually gets up to around 600-700M over the course of 3 or 4 days, after which it generally just dies. Otherwise, I have to kill it due to its slowness.

    Why not leave IE to Microsoft; put your effort toward something you can actually fix rather than being an ankle-biting ass.