Slashdot Mirror


Mopping Up Mozilla Memory Leaks

mouseman writes "Geodesic Systems, a maker of memory management/debugging software, has a live demo of their Linux product running on the Mozilla nightly builds. It's pretty damn slick -- it detects memory leaks and can show where in the code the leaked memory was allocated and actually recover (GC) the leaked memory. The Mozilla reports actually look pretty good, which jibes with my own impressions of how much it has improved -- see for yourself."

88 of 280 comments (clear)

  1. Just what they need... by Sorthum · · Score: 2, Insightful

    Wish they'd come out with a port for Win32. I've had more programs (usually file sharing services) eat up both memory and processor cycles to the point that everything came to a standstill.

    1. Re:Just what they need... by mellon · · Score: 4, Informative

      It does work on win32!

    2. Re:Just what they need... by Mr.Intel · · Score: 5, Informative

      Their Analyzer product order page shows a drop down for Linux, Solaris and WIndows 2000. My guess would be they have a port already.

      --
      ASCII tastes bad dude.
      Binary it is then.
    3. Re:Just what they need... by charles+fiterman · · Score: 2, Informative

      We do have one. Try www.geodesic.com

  2. Alternative memory debugger by nzkoz · · Score: 5, Informative

    As an alternative to this one and purify, I've been using valgrind lately (http://developer.kde.org/~sewardj/). It's defintely worth a look for those of you who don't have access to these commercial tools.

    Of course it doesn't do much in the way of garbage collection (well, anything) but it's still a great tool.

    --
    Cheers Koz
  3. I wish I had a memory lead detector... by Eric+Damron · · Score: 4, Funny

    'cause I think I'm of the age that most of my memory is leaking all over the floor....

    Now where did I put that mop and bucket?

    --
    The race isn't always to the swift... but that's the way to bet!
    1. Re:I wish I had a memory lead detector... by Beliskner · · Score: 2, Funny

      Sometimes memory leaks are a good thing to test tolerance for a massive numbers of zombie processes! Leave them in, let malloc() have some fun. Tell your boss, "I'm testing the swapfile", and then say,
      "These memory leaks demonstrate that as more memory is used for a process, the less effective the L1 and L2 become and the more delays you get due to the massive pipeline stalls in the P4. So that's why we need to upgrade to AMD, *please* sign my expenses form immediately and ignore that pron and DVD recorder"

      Memory leak detector. Great I need one of those because, uhhhh can't remember. I need to get rid of a bug which does a malloc and then uhhh oh man it just slipped my mind. My computer doesn't need a memory leak detector, instead the thing that needs a memory leak detector is uhhhh I was about to say something but forgot.

      Moral of the story: A PDA is better at stopping memory leaks than any memory leak detector.

      --
      A caveman dreams of being us, the incalculable power and riches. We dream of being Q, then what?
  4. Interesting by martial · · Score: 2, Interesting

    I must confess that since Purify is not available for Linux, we are always looking for interesting pieces of software to do this job.

    Now the only question I have are :
    1) can it be used as a debugger too ?
    2) how does it compare to other systems like electricfence ?

    --
    -- Martial MICHEL
    1. Re:Interesting by mpsmps · · Score: 2, Informative

      > I must confess that since Purify is not
      > available for Linux, we are always looking for
      > interesting pieces of software to do this job.

      > Now the only question I have are :
      > 1) can it be used as a debugger too ?
      Yes

      > 2) how does it compare to other systems like electricfence ?
      Take a look at the demo (perhaps when it is less slashdotted) and draw your own conclusion. It is pretty self-explanatory.

    2. Re:Interesting by Quixote · · Score: 2

      Try Insure++ from ParaSoft. It catches more memory leaks, memory corruption and other kinds of errors than Purify, and is available for Linux.
      I've been an Insure (was Insight) user for 5-6 years now, and it is a wonderful tool. It will save you many person-hours of painful debugging, especially if you use C (like we do).

  5. YES!! by JoeLinux · · Score: 2, Interesting

    Ever since .9.7, Mozilla has been running so damn fast and stable that it replaced my old Browser (Nutscrape). I'm not surprised at all. IT renders pages faster than IE does. I'm quite happy with it.

    JoeLinux

    1. Re:YES!! by colmore · · Score: 2

      Download Moz 9.9 and IE 6.0 and compare for yourself.

      The only thing that MS is faster at is startup, and this is comparing Win32 to Win32. Moz is even faster on Linux.

      I use Moz as my Windows browser 99% of the time, the only time I load up IE is to test pages I design for compatibility, and to view corporate sites that insist on using non-standard HTML. ("Best viewed with IE = Not W3C compliant")

      --
      In Capitalist America, bank robs you!
    2. Re:YES!! by BrookHarty · · Score: 2

      I have moved to Mozilla also, only a couple things I miss, a good spell checker (I still use netscape for my email) the win32spell.xpi is a work in progress so it should get better. So, no, Mozilla isnt only a web browser. (Flame away, but its a NETSCAPE replacement which includes E-MAIL...)

      Also, I really like how IE on the favorites/bookmark bar, the last favorite on the right is a pull down list. This is the only thing I think Mozilla needs. Bookmarks on your personal toolbar should emulate IE. Annoying, but doable.

      And yes, why does finance, marketing and hr still make IE only websites? Everyone else in the company, even our administration websites from vendors work with Mozilla!

    3. Re:YES!! by colmore · · Score: 2

      of course that was 0.99

      but if Moz numbered like MS, where the first semi-stable build was 4.0, that probably wouldn't be too far off the mark.

      --
      In Capitalist America, bank robs you!
    4. Re:YES!! by Stary · · Score: 2
      My test was using Netscape 6.2

      ... which uses XUL, yes, not the Windows widgets. Which was the entire point.

      --
      Tomorrow will be cancelled due to lack of interest
    5. Re:YES!! by Panaflex · · Score: 2

      There are numerous ways to achieve this "smoothness"... double buffering, offscreen drawing, etc. You can't judge the actual speed of the render in this fashion, only that IE handles refresh better. The only true way would be to run the engine through a testing process.

      Pan

      --
      I said no... but I missed and it came out yes.
    6. Re:YES!! by JamesOfTheDesert · · Score: 2
      I am a windows user....

      GOD I HATE STUPID WINDOWS USERS

      Oh, self-loathing is so sad ...

      --

      Java is the blue pill
      Choose the red pill
    7. Re:YES!! by Panaflex · · Score: 2

      If we were living in reality, we wouldn't be blathering on about web browers, now would we? Reality is that which has a one-to-one coorispondance with our abilities of observation. Rabbits and dogs understand reality. Rabbits and dog's don't browse the web.

      I am, however a software engineer, so my first inclination is to offer up possible reasons for the "perception" of slowness, and things that could be improved.

      Personally I don't really care.

      --
      I said no... but I missed and it came out yes.
  6. Other Platforms by wazzzup · · Score: 4, Interesting

    Will this directly affect and improve Mozilla on non-Linux platforms? Would it have a use flagging the leaks in the Linux code and then making the code corrections on the OS X platform?

    1. Re:Other Platforms by cduffy · · Score: 2

      That they do, but leave it to buggy code to make sure that not all memory is freed properly. Memory leaks plauge every single OS, not just pre Win98 OSes.

      Err, no. When an application exits on a well-behaving OS, everything it malloc'd is free'd. Everything. Even if the folks writing the app screwed up. Even if the compiler screwed up. It all gets freed.

      Memory leaks can still happen in kernelspace (kmalloc'd stuff not being kfree'd), but that's hardly an issue -- kmallocs happen much more infrequently than real mallocs, and kernel code tends to be of much higher quality than userspace code (and far tighter, so one can see where the kmallocs and kfree pairs are in any one module/driver/source/other unit).

      The only other memory leaks are userspace, so when the program that's leaking dies or is restarted, the memory is reclaimed; hence, leaks in these apps are hardly a problem, except perhaps in long-running programs or really horrendous leaks. Several server systems (like apache) automatically restart their threads after handling a certain number of transactions so that in the event that some module or whatnot has added a small memory leak, it is prevented from becoming a problem even on long-running server processes.

      In short, ya can't pin it on buggy code -- a good OS won't care if the app code is buggy or not.

    2. Re:Other Platforms by Tom7 · · Score: 2

      > Perhaps we are talking about two very different things, I don't know. But I do know that
      > my original statement is quite correct. And somehow I think if I had just said that
      > Windows sucks and left Linux out of it that nobody would have challenged it.

      If you had said Windows 98 sucks, yes, nobody would have argued with that. But NT, 2000, XP, and flavors of unix shouldn't have this problem.

      I think the real problem is that your OS is not accurately reflecting how much memory is actually available. For instance, if it caches data read off the disk, it may very well keep the disk cache around after the process exits.

      Whether I free() my memory or not, the operating system has the exact same job at the end of a process's life. This *can't* be an application problem.

    3. Re:Other Platforms by Tom7 · · Score: 2


      > It certainly can be. I realize that any good OS has its memory protected, but there are
      > still many apps that allocate memory outside of their designated heap.

      How do they do that?
      These days, a process has a large unified address space, and if it needs memory, it gets it from there. The OS cleans up afterwards. Or are you talking about other resources? (Other resources may typically leak, I will not deny that.)

  7. Debugger integration? by Malc · · Score: 3, Interesting

    Does this product actually integrate with the debugger. For example, can it break on a line of code before it uses a dangling pointer?

    I've been using NuMega products within MSVC for a number of years. I used Purify before that. I haven't used the latest version from NuMega, but I've always had a lot of success with BoundsChecker (memory profiler, error detection, etc), True Time (performance profiler) and True Coverage (code usage profiler).

    I wouldn't even know where to start looking for open source equivalents of these products. Can anybody give me any pointers? Preferably for Windows, but also Linux. How does this product compare with the likes of those from NuMega and Rational?

    1. Re:Debugger integration? by charles+fiterman · · Score: 5, Informative

      We have a product that fixes premature frees. This means it will (if asked) ignore all frees and only collect memory when there are no more references to it. It will also eliminate storage leaks. This one isn't a debugging tool in that it doesn't point you at the bug, it just fixes it. We keep hearing people say "I'll go with that if I can take the speed hit." So they connect it and speed improves some times by multiple powers of ten. This is because sand is faster than rust. A single page fault can be slower than many collections combined. So if we eliminate storage leaks and prevent page faults the time we spend doing it is swamped by the time we save.

  8. Maybe not as pretty, but does the same thing... by lordpez · · Score: 5, Informative

    CCMalloc also detects memory leaks and shows you where they took place. Even uses the GPL! It might not be as easy to use (you link your program to it during compile instead of running the it on a completed binary), and doesnt have a web interface, but its functional, and has been out for years.

    I bet someone could write a ld_preload kind of thing that calls ccmalloc, and you could run it on the completed binary as well, so you could run 'ccmalloc ./a.out' just like the 'gsinject -d ./a.out' of this product.

    Here is ccmalloc's page.
    http://www.inf.ethz.ch/personal/biere/proje cts/ccm alloc/

    1. Re:Maybe not as pretty, but does the same thing... by Arethan · · Score: 3, Informative

      yea, it's called memprof. works great. And if you compiled your binary with debugging symbols on, it'll even give you line numbers and stack dumps.

  9. Garbage collector by PD · · Score: 4, Informative

    If you're writing C++ programs, you should be using a garbage collector, such as Geodesics, or the Boehm collector available freely on the net. I've heard various objections to collection, mostly boiling down to speed issues. At least with the Boehm collector, you can choose to manually manage some memory yourself. In that case, it should be treated as an optimization problem. Write your program with the collector, then profile it. Anywhere you can pinpoint the collector as a major slowdown, handle the memory yourself.

    1. Re:Garbage collector by Anonymous Coward · · Score: 3, Funny

      Hmm, but I like to store pointers p and q as a=p+q and b=p-q, and to access them as *((a+b)/2) and *((a-b)/2). If somehow I erase "a" but not "b", will these garbage collectors be smart enough to free locations p and q?

    2. Re:Garbage collector by sporty · · Score: 5, Funny

      For fun and profit!

      1. Do obscure pointer arithmatic for fun.
      2.
      3. Profit!

      Sorry.. I couldn't resist :)

      --

      -
      ping -f 255.255.255.255 # if only

    3. Re:Garbage collector by Peaker · · Score: 2

      It won't leak, it will crash. (It will become 'unreachable' and thus freed).

      Garbage collection in a pointer-arithmetic enabled language is doomed to suck.

    4. Re:Garbage collector by Peaker · · Score: 2

      C, C++ and other pointer-arithmetic enabled languages can only use conservative garbage collection, which is slow and hideous, and defeats the purpose of using a language like C or C++ in the first place.

      If you want high-level functions such as garbage collection, just use high-level languages that do it better (Java, Python, etc), profile the result, and write specific slower portions in C or C++.

    5. Re:Garbage collector by Fizzlewhiff · · Score: 2

      Information on the free Boehm collector can be found here.

      http://www.hpl.hp.com/personal/Hans_Boehm/gc/

      --

      'Same speed C but faster'
    6. Re:Garbage collector by Peaker · · Score: 2
      Its not only the hidden pointer problem, but also how conservative GC'ers work.

      They actually search your program's memory bytes for data that "looks like" pointers.

      This has significant disadvantages:

      A Conservative GC has to search through all of your memory bytes to find pointers, whereas a GC-enabled language will know at runtime exactly where the pointers are stored, making it much faster at collecting. This defeats the purpose of using a "fast execution" language in the first place.

      A Conservative GC has no way to know which piece of data is a pointer, and which is just data. This means that if you just store random data, you get random pointers, and a conservative GC will simply leak. This is definitely not the "Right way" to work.

      The information of which bytes in your program are pointers and which are just data is available at compiletime (and thus it can be available at runtime, too).

      Conservative GC is a "hack" around GC-disabled languages to try and get GC functionality, so it cannot use this data and must waste time searching for "pointer-like" data.

      If this doesn't suck, I don't know what does.

    7. Re:Garbage collector by PD · · Score: 2

      If this doesn't suck, I don't know what does

      Memory leaks?

      As to your arguments:

      #1: The Boehm collector can work the way you described, and works very well that way. BUT, you can specify options to the collector that disable that, or limit that behavior. Using the collector this way doesn't slow the program down.

      #2: Conservative collectors DO leak. That's part of their nature. But, the leak characteristics are entirely different. Leaks introduced by a human tend to grow until the program runs out of memory completely. Leaks introduced by a conservative collector grow in a bounded fashion, typically 2x the amount of memory required by a perfectly leak-free system. This "bounded leak" characteristic is not necessarily a bad thing, since it gives the safety of a garbage collector and the ability to plan an appropriate memory size for a server.

      You're right that GC is a "hack", but it works pretty damn well, and it can make a difference between a million line program that leaks like hell and crashes all the time, or a million line program that runs and doesn't crash.

      You're also right that the language isn't really meant to be garbage collected. I would like to see a "gc" keyword in a future language spec to provide support for an (optional) garbage collector.

  10. ccmalloc by Kev+Vance · · Score: 2, Informative

    Actually, ccmalloc has a mode like purify to automatically link itself in during the compile process. Not the same thing as preload, but it's just as easy. If you're using, say gcc, change your compiler from "gcc" to "ccmalloc gcc" and ccmalloc will do the rest.

    ccmalloc is a great utility to have if you can't get your hands on purify :)

    --
    F0 07 C7 C8
  11. Is there some other Mozilla out there by Aexia · · Score: 3, Interesting

    that I seem to be missing?

    After reading the Salon article about how improved and fast it was now, I decided to give it a whirl on my NT desktop at work.

    I uninstalled it after about 15 minutes. It was just slow. Sluggish in loading pages, slow in creating new windows, everything. Not only was it slower than IE 5.5 but what surprised me was that it was slower than *Netscape* 4.7, which is what I primarily use. It's a shame because it had some nice options.

    What am I missing? Is it not meant to run on NT? Is it debugging code? Would it run better on XP? I'd love to give it a chance but apparently, I got some other Mozilla browser instead of the one everyone here is raving about.

    1. Re:Is there some other Mozilla out there by the_2nd_coming · · Score: 2

      if you do, and you are not in love with using the Windos update app instead of just going to the site, you can get IEradicater from www.98lite.net

      Mozy will run a little faster and you will not have all that extra memory allocated to IE while not using it. it works on everything from Win 2k to win98 FE.

      --



      I am the Alpha and the Omega-3
    2. Re:Is there some other Mozilla out there by emok · · Score: 3, Informative

      Make sure you delete all your old profile and setting files before you reinstall again. Installing over a previous version causes problems.

      see: http://www.mozilla.org/releases/mozilla0.9.9/#inst all

    3. Re:Is there some other Mozilla out there by karmawarrior · · Score: 2

      I use it on NT. I have a fairly nippy machine, I used to run it on a 166MMX with 64Mb of memory and it was slow. 4x that amount of RAM and a P-III makes a huge difference, and it actually goes from being slower than IE (much slower) to much faster. I don't know why, it doesn't make sense to me, but there you have it.

      One thing though, opening new windows is something Moz is bad at. Try setting up the tabs feature which is both lightening fast, and in the opinion of everyone I've met a vast improvement. Again, this is one of those I don't know why things - if someone described the idea of tabs to me, I'd have said it sounds horrible. But it isn't.

      Be aware that while Mozilla is physically slower and more memory hungry, it's still a lighter browser over all. It takes around 66% of the download space of a recent MSIE, despite also having email and IRC and whatever, and even manages to be smaller than Netscape.

      Beautiful, just beautiful.

      --
      KMSMA (WWBD?)
    4. Re:Is there some other Mozilla out there by Aexia · · Score: 5, Interesting

      Be aware that while Mozilla is physically slower and more memory hungry, it's still a lighter browser over all. It takes around 66% of the download space of a recent MSIE, despite also having email and IRC and whatever, and even manages to be smaller than Netscape.

      It may be slower and consume more resources but at least it uses less disk space?

      That's really not an argument the open source community should be making.

    5. Re:Is there some other Mozilla out there by Dr.+Evil · · Score: 2

      No other Mozilla, no debugging code, it really is that fat and bloated. On a fast machine, it is faster than IE in some places. In others, it is pigishly slow.

      Being faster than IE in some places lets some people argue that it is faster and better than IE. It is not. I use Mozilla exclusively though. I find the performance disappointing but tolerable, however, it cuts out advertising and supports Internet standards.

      The memory footprint is abhorrant. The tool in the demo spots leaks, not usage. I've never had serious problems with leaks in any web browser. Normally they crash long before I have to worry about them consuming too much memory.

      I think Mozilla is particularly bad on Win32 OSes because the virtual memory managers in Windows will swap out unused allocated memory in exchange for HDD cache. This means if Mozilla is inactive for 10 minutes or so, it will get swapped out so that your drive cache can gain another 50MB. Oddly, IE doesn't appear to suffer from this. It would not be unlike Microsoft to introduce an undocumented API which allows apps to behave differently in swap, but that's just speculation.

      On the other hand Linux appears to use virtual memory as a last resort. I'm not sure which scheme I like better. Windows could use being less agressive in how it expands cache.

      Of course that is not to say that Mozilla isn't a pig. It is.

      I think Mozilla will revolutionize the Internet and the way in which web browsers work, but it might not be through their own success, it might be through opening of standards and immitation of their technology.

    6. Re:Is there some other Mozilla out there by karmawarrior · · Score: 2

      Where did I say disk space?

      --
      KMSMA (WWBD?)
    7. Re:Is there some other Mozilla out there by jayed_99 · · Score: 2

      I believe that he is interpreting:

      It takes around 66% of the download space of a recent MSIE...

      as "it takes less disk space than MSIE".

    8. Re:Is there some other Mozilla out there by Aexia · · Score: 2

      Where did I say disk space?

      You said:
      [I]t's still a lighter browser over all. It takes around 66% of the download space of a recent MSIE, despite also having email and IRC and whatever, and even manages to be smaller than Netscape.

      What exactly *were* you referring to then if not diskspace? Just the download file?

      Great, that's an even better argument.

      More bloat and less speed from a smaller file. Talk about efficiency. Maybe Microsoft could learn from this...

    9. Re:Is there some other Mozilla out there by Danse · · Score: 2

      I'm running Win2K here at work and aside from testing websites, I use Mozilla exclusively. Why? Because it supports standards, and has a lot more features I like than IE does. I like the tabbed browsing. I like the fine-grained (a lot better than IE at least) security controls and the ability to be prompted about cookies and be able to decide on the spot to block or allow all future cookies from any given site. Mozilla is full of conveniences, and it keeps getting better. Aside from the 40MB footprint, it rocks. It renders faster than IE, pops up just as quick when you use the quickload feature, creates windows just as quick. I don't know what some people are complaining about. I haven't seen anything that Mozilla is slower at yet. I have a decent PC here. P3 700MHz with 256MB RAM. It runs Moz just fine. My home PC has a faster processor, but only 128MB RAM, and it runs Moz just as well. I'm wondering what the complainers are using. I could see Moz sucking if you only have 64MB RAM. But with 128 and up it seems to zip right along. If they can shrink that footprint, they will go a long ways towards silencing a lot of the criticism I think.

      --
      It's not enough to bash in heads, you've got to bash in minds. - Captain Hammer
    10. Re:Is there some other Mozilla out there by squiggleslash · · Score: 2

      Let me guess - you have a cable modem, therefore you believe everyone else does too?

      --
      You are not alone. This is not normal. None of this is normal.
    11. Re:Is there some other Mozilla out there by BoneFlower · · Score: 2

      0.9.4 runs nice, fast as hell, stable on my PIV 1.6 256mb ram, under Linux Mandrake 8.1. Haven't used it on windows though... The really odd thing about this system though, overall, is its faster under linux overall, but it boots far faster under Windows. Odd.

    12. Re:Is there some other Mozilla out there by karmawarrior · · Score: 2

      Erm, ok:

      1. It was a throwaway comment.
      2. It's generally a good thing when the installation package is small. Sure, it's not 1.44megs so you can't bung it on a floppy, but as part of a standard install in a company, or something on your backups of stuff, it's pretty nice.
      3. Have you ever downloaded a multimegabyte file using a normal modem? No, didn't think so.

      Geez. If I said "This car has some problems, but it corners well" you'd have been back at me with "Oooooooooh! The car's huge and all you care about is that it has a big steering wheel!"

      Or "One thing I like about this way this chicken is cooked is that it's fairly spicy" would garner the response "Oh great. So you're eating this fattening chicken and risking botulism and all you care about is that it makes you sneeze!"

      Jesus H. Christ. Read what I fucking say next time ok? Is that too much to ask? Or couldn't you find anything more controvertial you could twist out of context today? I'm surprised you didn't go further: "5 million Cambodians are dead and all you can care about is saving precious bytes in your download folder", "India and Pakistan are on the verge of nuking one another, and you think Mozilla rocks because it's got a good installer?" "Yeah, I know who else made compact installation packages too: Hitler. That was what Hitler did!"

      Geez.

      --
      KMSMA (WWBD?)
  12. Have to Check it out after the beatings by Greyfox · · Score: 4, Informative

    Once they've recovered from their thorough slashdotting I'll have to go check 'em out. Efence alone has saved me multiple weeks of debugging time, allowing me to track down memory leaks in our horrid application instantly. This translates into thousands of dollars of development time that can be put to more productive use. I'd estimate that efence has saved my group over 12 thousand dollars in debugging time this year. Now if only I could convince the boss to channel even a small portion of that back into the open source community...

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    1. Re:Have to Check it out after the beatings by Tom7 · · Score: 2

      Now, imagine what would happen to productivity if you just programmed in a language where these kinds of bugs (and others that efence does not catch) simply couldn't happen! Don't forget that in order for efence or purify (or great circle, for that matter) to work, you need to be able to trigger the bug at run-time...

    2. Re:Have to Check it out after the beatings by Greyfox · · Score: 2
      While I do like memory safe languages and feel that C gives not only allows you to shoot yourself in the foot this way, it also paints a bulls eye on your shoe, I'm afraid that nothing will protect you from a bad programmer. Most of my department's woes are due to the fact that the project started out as a small one-person endeavor and the first 3 years of its life it was written and maintained by people who didn't really know how to program in C. People who knew the original programmer told me that he was learning C as he went. Hence the complete lack of data structures, constants and in some cases functions (One of the C files has a 8,000 line function in it.)

      A similarly ugly pile of Java code was delivered to our team to maintain just recently. This was the result of an attempt to migrate some of our functionality to Java and the project was handed to a guy with no CS experience in school or out. He ended up copying the (hideous) design of the existing C code and delivered code that was not only as hideous as the original C code, it was harder to maintain due to a complete lack of comments (Which was in turn due to a complete lack of understanding about what the product actually does.)

      Much of the project is, in fact, set to be ported to Java at some point. I believe the team doing that is currently about a year behind schedule. This does not so much reflect on their abilities as programmers (With certain exceptions) but rather that the system is actually being designed this time and involves business units from several geographic locations and code from about a dozen diverse teams.

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  13. Open Source gives back by Anonymous Coward · · Score: 5, Funny

    This is a great example of the Open Source community giving back to private companies. Geodesic tests an OSS web-browser, and Slashdot stress-tests their web server.

    1. Re:Open Source gives back by Reziac · · Score: 2

      And they're using that lame javascript browser detector that complains "You need to get a frames-capable browser" if you have javascript turned off (like a sensible person), and only shows THAT much if you view source. (Display comes up blank.)

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  14. memory leaks, moz, and slash by Alien54 · · Score: 5, Funny
    I know that when I have moderator status here on slash, I can watch the system resources disappear down a block hole if I hit a story with a lot of comments and I use Moz.

    You can hear me screaming down the street.

    It is a little better under IE, but I prefer to use Moz.

    --
    "It is a greater offense to steal men's labor, than their clothes"
    1. Re:memory leaks, moz, and slash by nzhavok · · Score: 2

      I never have any problem when I'm using opera 5 with mod points - even with huge amounts of comments. OTOH Opera does seem to have a problem with sites which use mod_auth type logins but that's another story...

      --

      He who defends everything, defends nothing. -- Fredrick The Great
  15. Memory Usage Trends by joelgrimes · · Score: 5, Informative

    Over the last 6 months, every time I download a nightly or milestone, I've been recording the results of the following test.

    Download the installer and run it. Moz will launch automatically after install. Kill Mozilla and restart it. Bring up the task manager to see how much memory is used.

    Here's the results I've had on my W2k box:

    2001 10/01 build 03 22,540k
    2001 10/15 build 06 21,876k
    2001 10/18 build 03 21,692k
    2001 10/23 build 09 21,984k
    2001 11/16 build 03 21,952k
    2001 11/29 build 03 21,656k
    2001 12/06 build 03 19,868k
    2001 12/10 build 03 19,812k
    2002 01/07 build 03 18,124k
    2002 01/14 build 03 19,064k
    2002 01/17 build 04 19,244k
    2002 02/26 build 03 18,608k
    2002 03/06 build 04 18,220k
    2002 03/11 build 04 17,704k (build 0.9.9)

    That's a decrease of almost 5 megs in memory usage over six months - all the while they've been adding features.
    Significantly, they've added venkman, tabbed browsing, the dom inspector and favicon support.

    Also significant - I don't know why I bother to get the talkback builds anymore - I haven't submitted a crash in 3 months. And I run it all day, every day.

    1. Re:Memory Usage Trends by Peyna · · Score: 2
      I just fired up IE 6 on XP, and it is using 10,648k of memory. =]

      Mozilla 0.9.9 is using 16,683k on the same machine and OS. I think the decrease in memory usage has to do with removal of a lot of debugging stuff and what not, that'd be my guess. How much optimization is taking place with Mozilla, and how much time is spent on new features and bug fixes?

      --
      What?
    2. Re:Memory Usage Trends by brad3378 · · Score: 2

      This is great news!
      Mozilla is decreasing in size by 1 meg per month.
      At the going rate, Mozilla won't take up any memory by August 2003 !! Imagine the start up times! How will IE compete?

      ;-)

      --

  16. memprof by Arethan · · Score: 5, Informative

    I tried mentioning this in a thread, but it was too quickly drown out. There is a free product that does ld_preload style memory leak detection. It even does memory allocation profiling, so you can find that hidden 'for' loop that is responsible for that extra 15MB of allocated memory. The gui is done with gtk+, so it's easy to use, and will run on most any linux distro these days.

    It's available at http://people.redhat.com/otaylor/memprof/
    Freshmeat has an entry for it as well.

  17. What I'd really like... by mateub · · Score: 2, Interesting
    ...is a cross-platform tool. We are working on a project (in C++) at work that runs on HP-UX, Linux and Windows-under-Cygwin (a little English town near Stratford-on-Avonshire). What I really want is ONE tool that I can use on ALL these platforms. We use ElectricFence on HP-UX and Linux, but no luck under Cygwin so far. Purify doesn't work under Cygwin either, only MS. First tool to support all three of these gets our vote and even our money.

    adéu,
    Mateu

    --
    "And we're happy here, but we live in fear, we've seen a lot of temples crumble..." - Concrete Blonde
    1. Re:What I'd really like... by don_weber · · Score: 2, Informative

      Geodesic supports HP-UX, Linux and Windows under Cygwin.

  18. Garbage collectors, leak detection, and Mozilla by Lumpish+Scholar · · Score: 4, Informative
    ... memprof is based on the same Boehm [garbage collector] that Geodesic is, though Geodesic's is a closed source fork.
    Which is pretty funny, because the Boehm-Demers-Weiser garbage collector is already used (cache) with Mozilla (cache) to detect leaks.
    --
    Stupid job ads, weird spam, occasional insight at
  19. Moz fonts by PurpleFloyd · · Score: 2

    The problem is that on Linux systems, it's hard to get 'free' fonts that look good. Most fonts on Linux are bitmapped, and thus don't scale well. The following upgrade will help all applications work better, especially if you alias your 'helvetica' font to 'arial' and your 'times' font to 'times new roman'. Go to Microsoft's "web core fonts" site and download the .exe files. Extract with a program like cabextract (they're just cab files with a self-extracting wrapper). Put them in your X server's fonts directory. Restart the X server (and the fonts server, if you use Redhat). Set up Moz to use the new fonts. Marvel at the beautiful scaling of TrueType fonts. All is better ;).

    --

    That's it. I'm no longer part of Team Sanity.
  20. IE6 is part of windows itself by HanzoSan · · Score: 2


    So how much memory does the windows Kernel, Explorer.exe and IE6 use all together?

    You cant find out how much memory IE6 uses on WindowsXP, maybe on Windows95 you can.

    --
    If you use Linux, please help development of Autopac
    1. Re:IE6 is part of windows itself by Peyna · · Score: 2

      Then you better count how much memory X is using when you are using Mozilla to make it fair. IE will run on shells other than explorer, and probably use the same amount of memory.

      --
      What?
    2. Re:IE6 is part of windows itself by scrod · · Score: 2

      Not really. Does X window contain HTML rendering routines? Nope. X window is to GDI+ as Mozilla is to IE. In other words, Mozilla doesn't rely on X window any more than any other app out there. Really large parts of IE are integrated into Windows--it's just a fact.

    3. Re:IE6 is part of windows itself by HanzoSan · · Score: 2


      Yeah thats why when IE crashes, Explorer.exe crashes.

      IE is part of explorer.exe

      You can kill explorer.exe and still run IE, it doesnt change the fact that IE is a component for Explore.exe,

      Mozilla is a seperate program using XUL to for the interface which is why its slower, its NOT native.

      IEs interface components are part of Explorer and the Kernel so the interface is faster.

      --
      If you use Linux, please help development of Autopac
  21. Stop using pentium 4/586! by HanzoSan · · Score: 2



    Mozilla requires 300mhz machine at LEAST.

    You shouldnt be using it on an old as hell machine. Its slow because your CPU is slow, period. they cant make your CPU faster. I mean the problems you complain about are CPU load problems not problems with ram.

    --
    If you use Linux, please help development of Autopac
    1. Re:Stop using pentium 4/586! by jilles · · Score: 2

      "Why we must buy faster CPU instead of them fixing bugs that causes sluggish performance especially on UI?"

      Because CPU's are dirt cheap. The amount of money you need to buy a modern CPU (low end) gives you one, maybe two hours programming time of a junior programmer. A professional programmer earns much more per hour and is good for maybe around 5 to 10 minutes of his/her time. So don't waste his/her time and buy a new CPU with the hardware to insert it into. You can pick up good second hand hardware for a price that is just about the same price of most commercial software packages (if you insist on being a cheap bastard). If it is your hobby to run new software on old hardware that's your problem.

      --

      Jilles
  22. Memory Leak Detectors and Garbage Collectors by Taco+Cowboy · · Score: 5, Informative



    I'm gonna need people's help to add to the list below.

    Here is a list of (freeware) Memory Leak Detectors and Garbage Collectors -

    ccmalloc
    http://www.inf.ethz.ch/personal/biere/projects/ccm alloc/

    Valgrind
    http://developer.kde.org/~sewardj/

    Boehm Collector
    http://www.hpl.hp.com/personal/Hans_Boehm/gc/

    Parallel Collector on Message Passing Environment
    http://www.yl.is.s.u-tokyo.ac.jp/gc/dgc/

    If there are more out there, would you kindly add what you have to the list, please ?

    Thank you !

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:Memory Leak Detectors and Garbage Collectors by cortense · · Score: 3, Informative

      LeakTracer
      http://www.andreasen.org/LeakTracer/

      MemWatch
      http://www.linkdata.se/sourcecode.html

      These are two free memory debuggers that I've used, and had much success with.

  23. Re:Thank Bruce Perens by ethereal · · Score: 2, Funny

    Wow, I think this is the first time I've ever seen an AC say something nice about Bruce Perens. I'm in shock!

    --

    Your right to not believe: Americans United for Separation of Church and

  24. Who needs garbage collection? by Peaker · · Score: 3, Insightful

    "How hard is it to manage pointers and free your memory allocations anyways?"

    (To those who didn't get it, I was being cynical)

    That is the response I usually get when advising to write using high-level languages that take care of memory management. Finding enormous leakage in huge programs almost proves this response wrong. Finding leakage in almost all programs definitely proves it wrong, and you sure will find leakage in almost every large program written in a low-level language like C or C++.

    The overuse of low-level languages with increasingly powerful hardware is becoming appearant to more and more people. It seems the "dark side" will be out of the low-level language hell sooner, as Micros~1 is pushing C# and .NET with all their marketing strength.

    If you don't want the Linux/*nix world to stay behind, stop using C and C++ where Python and Lisp can be used. Writing in C or C++ instead of a higher-level language can be deemed as a premature optimization, as any specific part of the program can be optimized and written in C when necessary. We all know how evil premature optimization is.

    If you write in C or C++ because that's simply what you know, you should not be wary of learning new languages. You should know that C++ is extremely hellish to learn, while Java is a lot simpler, and Python takes at most a day or two!

    From my own personal exprience, functional languages are a bit more difficult to learn and grasp, but it seems they perfectly fit some mindsets.

    Stop wasting human power on writing destructors and freeing unused memory, when it can all be done automatically.

    1. Re:Who needs garbage collection? by ftobin · · Score: 2

      C and C++ are definitely assembly-level languages. C especially can almost be translated to assembly fairly straightforward; it's just a nicer syntax for assembly. Both languages, however, force you to deal with 'machine' issues, such as allocating and freeing memory. In higher level languages, such as ML, scripting languages, and (kind of) Java, you don't worry about keeping the 'machine' happy.

      There is a whole slew of non-low-level languages that are out there. Work with them and learn what is 'high' and what is 'low'. It's a sad situation that we're stuck with so many people writing everyday applications in assembly-level languages.

    2. Re:Who needs garbage collection? by Peaker · · Score: 2

      That's reference counting, not garbage collection.

      It frees memory slower than most modern garbage collectors and it doesn't work for cyclic references.

    3. Re:Who needs garbage collection? by Peaker · · Score: 2

      I didn't suggest that C++ is hard to learn because it requires low-level memory management.
      I suggested it so people understand learning new languages will not be as hard as it was to learn C++ (or Perl).

    4. Re:Who needs garbage collection? by Peaker · · Score: 2

      There's a JVM or Python interpreter on any platform Mozilla can run.
      There aren't always C++ compilers or libraries for those platforms.
      I doubt C and C++ are the most portable, except for tiny hardware which cannot run JVM's or a Python interpreter (in which case, cannot run Mozilla either)

    5. Re:Who needs garbage collection? by cduffy · · Score: 2

      The requirements for processing a company's payroll is not what is appropriate for these "safe" languages. Would you like your paycheck to be delayed for a day or two? How about a week?

      A day or two?!

      Almost all the work involved in that kind of thing is done in underlying libraries -- database retrieval, output formatting, and so forth. I'm actually involved in maintenance of the software running a mid-sized car dealership, and can say with absolute certainty that the bottlenecks involved in payroll processing (and importing new partlist data, and credit report retrieval, &c) aren't even remotely related to high-level code execution speed. In fact, we've had (much!) bigger problems when payroll (in particular, commissions) were delayed due to bugs in the old code; and office workers stalled by crashes in our unsafe code have cost the company far, far more than the unnoticable decrease in execution time involved in our newer, safe code.

      We're not talking a matter of days, but of seconds if that -- even dealing with large datasets, the bottleneck is almost always in the database itself (and other I/O issues) and not in the control language (and other CPU-time issues).

  25. Nice leak detectors built into Mac OS X by Mneme · · Score: 5, Informative

    The Mac OS X's malloc library has built-in support for providing good leak detection. The command line tool leaks (installed with the free developer tools). Although leaks can be run on any program, it works best when you set the enviromment variable MallocStackLogging, which causes the system to provide complete stack frame information about when each piece of leaking memory was allocated.

    Also of interest are the malloc_history and heap command-line tools. They tell you lots of interesting information about exactly what is on the heap and how it got there. The malloc library also detects double frees by default (making it immune to the recent zlib security vulnerability) and can also detect writing on free blocks, etc. Very nice.

    Finally there is a graphical application, MallocDebug which provides similar information on memory leaks and memory use but also provides an easy to use memory-browser interface. Unlike simple leak detectors, you can explore your program's memory space and discover memory that isn't strictly "forgotten" by your program (it still has valid references to it) but should perhaps have been deleted anyway (e.g., finding memory allocated for a splash screen graphic). This last application requires that the code use a special library, but it is easy enough to make dynamically-linked programs use this library (thanks to Darwin's equivalent of LD_PRELOAD, DYLD_INSERT_LIBRARIES).

    Although you can debug any code with these tools (from command-line tool to X-windows, Carbon or Cocoa app), they really shine debugging Objective-C, because Objective-C provides enough runtime information for the tools to tell you lots about the objects that are sitting there on the heap.

  26. MozillaQuest by Anonymous Coward · · Score: 2, Funny
    Soon on www.mozillaquest.com:
    Mozilla leaks out of control
    Mozillas memory leaks are out of control. Things has become so bad that mozilla-developers has developed a webapplication that automatically detects leaks. Yet again we can see that mozilla management is unable to keep the developers focused on developing a browser which has resulted in yet new features instead of fixing bugs. In previous articles MozillaQuest has described how new features has deleyed milestones and caused new bugs.
  27. Re:System Resources on Windows 9x by Alien54 · · Score: 2
    Under Windows 95, 98, and ME, the USER.EXE and GDI.EXE resource heaps are each limited to 64 kilobytes. (Windows NT, 2000, and XP have no such limit.) This bites me in the butt on K5 too.

    Which is just another reason for me to finally get off my butt and build that freebsd box i've been thinking of.

    --
    "It is a greater offense to steal men's labor, than their clothes"
  28. you don't need Geodesic's stuff by markj02 · · Score: 4, Informative
    If you want leak detection and garbage collection, use the Boehm/Weiser/Dehmers garbage collector. It works with C, C++, and a lot of other languages. Mozilla should probably be using it by default. For plain leak detection, there are plenty of highly functional open source packages. "dmalloc" comes to mind (although it's not completely unencumbered). For array bounds violations, you can use valgrind, ElectricFence, and other free tools.

    A more basic question to ask, however, is why something like Mozilla has memory leaks in the first place. Avoiding memory leaks in C is hard because there simply are no hooks in C to automate resource management. But C++ has constructs that make writing leak-free code and code that doesn't use bad pointers pretty easy. Since switching from C to C++ a few years ago, memory leaks and bad pointers have simply not been an issue anymore in my code.

  29. Re:It is definitely slower than NS4.7 by skt · · Score: 2

    I wouldn't say that it is "slower" than NS4. Mozilla does use more memory which does cause it to load slower, but the page rendering speed compared to NS4 is much faster. New windows also seem to load slower on mozilla which is one gripe of mine, but I figure it's due to XUL or something not native. It has been said before, but you can work around that delay by using tabs and CTRL+L instead of CTRL+SHIFT+L (for example).

    Low memory machines might still find NS4 faster overall, I haven't really had a chance to try mozilla on a loaded 32MB machine yet. At work, we have many of these left in use and they have to run software like mcafee which uses a huge amount of memory itself. There won't be much RAM after that to make mozilla happy I don't think :(

  30. spellchecker by ksheff · · Score: 2, Informative

    Have you tried out the one at http://spellchecker.mozdev.org?

    --
    the good ground has been paved over by suicidal maniacs
  31. Netscape WAS Mosaic by HanzoSan · · Score: 2



    Netscape was the company who originally made Mosiac if i remember right, before they were called netscape.

    --
    If you use Linux, please help development of Autopac
    1. Re:Netscape WAS Mosaic by Reziac · · Score: 2

      I have a standalone netscape.exe that calls itself "Netscape Mosaic 0.99 beta". I use it as a Q&D test to see if my web pages will be tolerably legible in Lynx, since it seems to handle major layout elements more or less similarly.

      IIRC you can get even older versions at http://browsers.evolt.org/index.cfm/dir/navigator/

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  32. I've tracked this specific leak for 5 YEARS now... by Reziac · · Score: 2
    Someone says,

    I know that when I have moderator status here on slash, I can watch the system resources disappear down a block hole if I hit a story with a lot of comments and I use Moz.... It is a little better under IE, but I prefer to use Moz.

    I've been tracking this particular bug for a LONG time, and couldn't get anyone at the former Netscape to do anything about it. I haven't pestered the current Netscape or Mozilla teams because I haven't actually used the current browsers, and consequently expected I'd receive a poor welcome. But it sounds like the bug IS in still in the codebase, per the above-quoted comment.

    Specifically, the resource leak occurs when there are a lot of links INSIDE table cells, AND those links contain a lot of text. This apparently has a trigger threshold since if you sufficiently cut down the amount of text displayed as links, the leak goes away. Worst case, a large table with lots of long links can suck resources to zero in 30 seconds flat.

    It appears that checkboxes, radio buttons, and dropdown boxes occuring inside table cells can also trigger the problem, tho I don't have this pinned down to exact cases.

    Symptoms vary with the NS version and the WinVersion under it, but in general you will notice oddities like vertically overlapping text and checkboxes that go invisible. An example that affects NS3.04 is Slashdot's own "User Preferences" page, with its zillion checkboxes.

    This bug is apparently in ALL versions of Netscape, but only visibly manifests in certain versions. To my certain knowledge, 3.04-16bit (running on Win16 or Win32), 3.04-32bit, and 4.64 are the worst affected, but apparently it can be triggered in ANY version if you work at it hard enough. 3.02-16bit Gold, 4.00-32bit, and 4.04-32bit are somewhat less affected than average.

    People using the old Delphi forums (which were horrible for triggering the leak) griped about the symptoms constantly, regardless of NS version. Of course most had no idea what was happening, only that using Delphi crashed their computer.

    So long as you haven't actually zeroed out the system, resources will usually recover by 90+% after you leave the triggering page.

    The bug is ALSO definitely in IE3.0. I don't personally know about other versions other than that IE5.01 seems somewhat resistant to it (but I only use IE as a last resort, so...) But per the quoted comment, the bug is clearly not absent in recentish versions (I assume no one here is insane enough to still be using IE3 :)

    Correct me if I remember wrongly, but don't IE and NS both ultimately derive from the Mosaic codebase? The implication is that this is a core bug in the foundation code.

    BTW there is also a resource leak that happens if you view a page that has SWF on it, but you do NOT have the SWF plugin installed. The leak is approx. 25% per SWF box per page, and unlike the above-mentioned leak, resources do NOT recover when you leave the affected page. This affects NS 3.04-32bit and 4.04-32bit equally, haven't checked other versions. I suspect this is another manifestation of the same leak, since SWF-inside-tables also seems to be involved.

    Affected sample of the SWF/tables resource leak: http://www.blkviper.com/index.html (however, NO leak IF you have the SWF plugin installed).

    I'm not a coder, but I can contribute testing if desired.. I hope this information finds its way to the appropriate people (or if someone knows who I should contact, I'll do it myself), and that this bug is finally fixed!

    --
    ~REZ~ #43301. Who'd fake being me anyway?