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."
Is such an approach also useable for finding firefox leaks? As a user (not developer, alas) I'm noticing that it invariably gets sluggish after some period of time, even with few pages open.
see a Text Widget
The true source of IE memory leaks?
Korean outsourcing
here's something that helped me with this recently:
Mongrel News all the news that fits and froths
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.
Everytime I try to download ten things firefox goes up to 300 megs of memory usage and 99% cpu usage. And I took the screenshots to prove it.
Frankly, I think you can find problems and features you hate in most programs of a certain size, what matters is that you find the tool for the job that you consider the best match for your needs.
would be sealing it in a cement box and chaining the lid shut. I cannot believe that after all the
...
vulnerabilities, bad experiences, and poignant advice, people still continue to use it.
The alternatives aint perfect but they are a hell of a lot better.
"Microsoft Internet Explorer 6.x with all vendor patches installed and all vendor workarounds applied, is currently affected by one or more Secunia advisories rated Highly critical"
"Currently, 20 out of 81 Secunia advisories, is marked as "Unpatched" in the Secunia database."
http://secunia.com/product/11/
Join the Slashcott! Feb 10 thru Feb 17!
Actually, it's very easy to make a site not run on IE; as the following example shows.
.
<?
if (preg_match("/MSIE/i", $_SERVER["HTTP_USER_AGENT"])) {
header("Location: http://www.mozilla.org/products/firefox/");
exit();
};
?>
<html>
<head>
<title>This site will not display in Internet Explorer</title>
.
.
.
</head>
<body>
.
.
</body>
</html>
Je fume. Tu fumes. Nous fûmes!
because it's your job?
I don't know why you geeks have such a downer on Microsoft for writing buggy software. If it didn't, do you have any idea about how many of you would be out of a job? The capitalisation that flows from Microsofts inability to write good operating systems is immeasurable. If it worked first time - would there be any engineers?
It's sort of analogous to cruise liners. Used to be, because ships weren't terribly well made, a clipper had a huge crew of dirty, scurvey suffering swabbers. Nowadays, you have one captain and a big computer. Currently, IT graduates, computer consultants and systems administraters are that huge crew of disease ridden reprobates, serving on the creaking, rotten, old fashioned Microsoft vessel. And all you want is to be out of a job?
Where's the logic in that??
Meine Schwester ist sehr, sehr reizvoll - Nietzsche
As I understand it, Firefox makes aggressive use of unused resources. If you're not having any slowdowns, then take a deep breath and realize that it's just doing what it's supposed to do.
If you do have accompanying slowdowns, then you have a specific, rare problem. See the other replies you've gotten so far for suggestions.
If you work around a problem, it hides from the user that the problem exists. The demand to have it fixed, therefore, dissipates and developers accept the onus to repeat work-arounds everytime they deploy something. Ultimately, the browser fails to improve, and the costs of errors are passed from the vendor (Microsoft) who never fixes the problem to the public (developers that waste time with work-arounds).
Anyway, if you write things specifically for IE -- then you've already got a more serious problem that you have to address first. There's no excuse for what you already know to be dismal practice.
Well, the memory remains allocated to the application. The thing is, it's a programming bug. The application allocates a piece of memory but never releases it, not even when it's not needed anymore. In a managed environment like .NET or JVM, a garbage collector periodically checks whether a certain piece of code or memory is still active, and when it's not it gets "collected" (freed).
If any of you would RTFA, you'd find that the tool doesn't address leaks in Internet Explorer: It identifies web page code that cause leaks because the developer coded poorly. It doesn't matter what browser you use, people can still write web pages that will cause it to leak memory...
On un*x the memory is returned when you close the app. Usually that is the case on NT based (XP is just NT 5.1) systems as well. In Windows 9x normal memory is often returned but USER/GDI (only 64k of each) memory that has been leaked is lost until the next reboot. In Windows 3.x once USER/GDI memory is used by an app it can never be freed even if the app is very well behaved and tries to free all memory on exiting.
IMHO, It's laughable to mock IE for memory leaks when Firefox is X (where X > 1) times worse at sucking up and retaining memory.
People have relentlessly said the reason IE is faster to load than IE on Win32 is because it is "embedded into the OS" and somehow brushed off this advantage in favour of it's debateable disadvantage in terms of security. What's next? Will slashdotters crying out something along the lines of "WOW! IE, an embedded part of the Windows, has memory leaks! What does that say for the Operating System? You better use Linux!"?
IE may be guilty of having a buggy implementation of web standards such as CSS2.1 but during the browser wars wasn't it IE producing functionality that hadn't even been drafted by the W3C yet?
Isn't that "Internet Explorer's architecture made this app fairly easy to build." as testament to the browser?
This tool is interesing and useful for developers and I thank jgwebber for writing it as I'm sure it'll be useful even to lowly personal developers like me.
On the other hand i'm a bit baffled as to why this article wasn't simply written as "Hey IE has memory leaks, checkout this new tool by jgwebber and see for youself. Let's discuss how sucky Internet Explorer is and cover up all the flaws in competitor browsers".
It would have had the same effect as CowboyNeal's unnecessary "(ha!)"'s and claims of IE's "horrendous memory leak issues" without a link giving some evidence for these claims for those of us without first-hand DHTML development experience.
I truly wasn't aware of any serious IE memory leaks..i'm going to, go off and Google for information now using the cumbersome Firefox. Any links would be much appreciated since CowboyNeal didn't bother.
>>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).
You say that like it's a good thing(!)
"Internet Explorer's architecture made this app fairly easy to build." as testament to the browser?
No; for some pretty obvious reasons: one obvious one being, you exclude anyone not using that particular browser. I thought everyone realised that was a Bad Thing - or maybe you haven't been one of those people who can't use their online bank because the bank decided to arbitrarily depend on IE. One can only hope that accessibility laws will put an end to such stupidities.
It's not surprising that both browser products have memory leaks. However one could reflect deeply on the differences in responsibility and approaches to remediation. In Firefox's case - being open source - you have complete transparency; you can file a bug on it, check the bug db, or even fix it yourself (don't laugh). In M$'s case, all you can do is kiss your money goodbye and hope they fix it "one day".
The same goes for all the rest of their system, too. It is not always obvious what a disturbing abdication of rights using a closed system is. A friend recently told me of a Visual $tudio crash triggered by a few \b backspace characters in a print statement. Not such a big deal, I thought at the time; but I found myself reflecting on his story later. Eventually the true horror of the situation sank in, which is that we have to completely trust the ability and goodwill of the vendor to deal with any and all issues in their O/S. That is no small responsibility and there is not much evidence that M$ is capable of fulfilling their end of the bargain. I would postulate, after RMS of course, that no closed and proprietary system on the scale of M$ products can be adequately maintained by one vendor. And of course maintenance becomes irrelevant when major "rewrites" are involved, such as have been prescribed by Longhr0n to fix W1ndows' fundamental ills (ref Spolsky on rewrites, Things You Should Never Do).
The thought that one has no recourse and indeed not even any way to inspect the system one uses (livelihood, etc), is deeply, deeply disturbing, and I again have to thank RMS for pointing out long ago what a dead-end that is, and for putting in place viable alternatives.
you had me at #!
You've obviously never done any embedded programming.
The low-level capabilities of C/C++ are there by design. That's why it contains the keywords union and register, for example.
What's more, if everyone jumps on the virtual machine and garbage collection bandwagons, new problems pop up. Abstractions and convienences inevitably foul up, and often lead to poor programs overall.
The onus for performance should rest with application developers, not compiler developers. Thus, the solution here is for developers to be properly trained and then to take responsibility for such matters as memory leaks. It looks to me that that's exactly what the Firefox team intends to do.
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.
Do you have ESP?
"Second, you add some new features. Like stealing compression code from Stacker, MS will just steal one of the "Tabbed browsing in IE" Plugins and muck the variable names up a bit."
Come on. That's a cheap shot. There is no indication that Microsoft stole any code whatsoever for IE7.
Ever wonder why Slashdot gets the reputation of being a bunch of crazy coots? Yep, it's people like you lobbing unfounded allegations against Microsoft.
There are plenty of valid reasons to attack Microsoft. You don't need to make shit up.
Normally, it leaks out onto the surface upon which the computer is resting, however I have connected some surgical rubber tubing to my computer and have thus routed the outflow into the sump in my basement, where it is periodically flushed into the rain sewer. I'm not entirely sure whether this is environmentally sound, or not, and I would appreciate anyone with more experience in proper disposal techniques for leaked memory giving me a heads up.
The higher the technology, the sharper that two-edged sword.