Thread: Research Help

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    58

    Research Help

    HI;

    I am doing a project on looking at free ware memory leak tools for C on linux.

    Now i know there is the commerical ones ie Purify which is a great tool but I like to know what you use and what you think its the best.

    Two freeware ones are electricfence and valgrind. Any other ones you use that are good or limited even?

    Any websites with the tools and how you set them up be great.

    Intending on using 4 of them.

    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    58
    I was more so looking for people's opinions what they used than jsut going by wikipedia.

    Surely as engineers we must have opinions on tools????

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    It's a little hard to recommend anything other than valgrind.

    There are alternatives, of course. Or this wouldn't be Linux we are talking about. Dmalloc, mpatrol and electric fence are the other three I know of. But individually they lack features present on valgrind and offer nothing that valgrind doesn't already, or so it seems to me.

    To me, the biggest con of valgrind is its lack of portability. It's wrapped tight around the linux kernel, the x86 instruction set and even the GNU C compiler. Porting it is extremely hard. Thus, the lack of it. But I suppose that's the price you pay for these type of advanced tools.

    There exists however a case for the methods these tools use:

    Valgrind does full code analysis, while mpatrol forcefully crashes your program on a memory leak, for instance. Crashing seem excellent for dealing with memory leaks on a case-by-case basis. Maybe for small projects. But for mid to large size projects, this can't be the way to deal with memory management bugs. Or can it?

    Well, for large projects, simpler tools in the form of a library that just replace the calls to malloc() and free() greatly simplify the most mundane memory debugging tasks, leaving a much cleaner program for valgrind to then take charge and work its magic on the most advanced debugging tasks. So, in fact, I think these tools complement each other even despite the obvious overlap. For small projects valgrind can be your only tool. But for large projects, I'd rather clean up the house a bit with tools like dmalloc, mpatrol and electric fence before moving on to valgrind.

    Note however I never developed a large project in Linux. So don't take my word for it. This is just my reasoning.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How does research with CS work?
    By dnguyen1022 in forum Tech Board
    Replies: 4
    Last Post: 05-03-2009, 08:33 PM
  2. Hwang Woo-Suk is a douchebag - how does this affect stem cell research?
    By Govtcheez in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-12-2006, 08:09 AM
  3. Research paper/Cryptography
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 09-05-2005, 10:52 AM
  4. Doing a research degree in IT?
    By khpuce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 04-22-2005, 01:08 PM
  5. Stem-Cell Research
    By Witch_King in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 08-13-2001, 07:38 AM