
Why you should worry about memory leaks - soundsop
http://developer.gnome.org/doc/guides/programming-guidelines/memory-leak.html
======
pfedor
Let's keep things in perspective. I'll take ten memory leaks over one
segmentation fault any day. Also, not every forgotten pointer constitutes a
memory leak. To talk about a memory leak, your program has to eat up the
amount of memory proportional to its running time, or input size. If you just
allocate some constant memory for your data structures at startup it is not a
memory leak. Still of course it's nice to free it up at exit (for example for
reasons mentioned in the article) but sometimes it's not convenient or
practical. So let's not get too uptight about it.

------
gcv
_[Mozilla] leaks like crazy_

Disturbing.

 _unref, free, g_free_

One of my professors joked that all non-trivial C and C++ projects begin with
hiring a guy who already wrote a garbage collector.

------
ComputerGuru
_This is one of Mozilla's problems right now: it leaks like crazy so how are
you ever going to know if you just added to the problem?_

Precisely. You should worry about memory leaks so you don't have web browsers
using up 800MiB while doing absolutely nothing and not using any plugins:
[http://neosmart.net/gallery/v/apps/Firefox/Firefox+Hole.png....](http://neosmart.net/gallery/v/apps/Firefox/Firefox+Hole.png.html)

Then again, when you're leaking several hundred MiB per tab in Version 2, you
can fix up a memory leak or two, halve the problem, then go around claiming
"extraordinary improvements to memory management" come version 3. Oh,
wait.....

------
LogicHoleFlaw
Maybe I'm just jaded, but this seems like a really basic primer on memory
management. Is mozilla failing to meet these standards? Somehow my guess is
that the challenges facing the project are a bit more sophisticated. I have
absolutely no evidence to support that supposition however.

~~~
ajross
This is a page from the Gnome developer guidelines. It's not about Firefox per
se. And it looks pretty old to me; they're talking about "Mozilla" as a
product, which it hasn't been for several years now. My guess is that this was
written during the early push for Gnome 2.0, maybe four years ago.

It's sane (if unsurprising) advice. Using it as evidence for the current state
of Firefox's memory management strikes me as a poor idea.

~~~
nostrademons
Stronger evidence for the current state of Firefox's memory management comes
from the Windows Task Manager ;-)

(284M and counting! Yesterday my Linux Firefox was at upwards of 350M, though
it's now at 144M after restarting it.)

------
wheels
valgrind is excellent for tracking down leaks and these days used quite
extensively in the open source world.

