1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Please suggest a C++ source code analysis tool for debugging memory leak

Discussion in 'C++' started by tommy_24, Apr 22, 2008.

  1. tommy_24

    tommy_24 New Member

    Joined:
    Feb 26, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi... we are providing software support for one of the famous retailers in U.S. The code has been written in C++. Our field test customers feel that the application software is very slow.
    Before we deliver the software to our clients, we are in a urge to improve the performance of the application. Some of our software engineers suspect that the memory dirty pages are too high in the application. They feel that the code have lot of memory leaks. Are there ways to improve the performance of the software?? Is there any tool that finds us the memory leaks in the code? Please suggest?
     
  2. imported_antony

    imported_antony New Member

    Joined:
    Feb 26, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    you can use Source code analysis tool like Coverity Prevent

    Hi, typically, a memory leak occurs because dynamically allocated memory has become unreachable. You can prevent memory leaks by watching for some common problems. Collection classes, such as hash tables and vectors, are common places to find the cause of a memory leak. This is particularly true if the class has been declared static and exists for the life of the application. . The prevalence of memory leak bugs has led to the development of a number of debugging tools to detect unreachable memory. Coverity Prevent is one of the tool that you can use for fixing these kinds of bugs. Coverity Prevent is also used by the Department of Homeland security to scan many open source projects. You can get more info at Coverity Webpage
     
  3. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    1
    Trophy Points:
    0
  4. imported_xpi0t0s

    imported_xpi0t0s New Member

    Joined:
    Jul 18, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    Memory leaks don't cause software to run slowly, what happens when a program leaks memory is that over time its memory usage grows and grows until eventually it keels over due to lack of memory.
    If anything the program runs faster because it isn't freeing objects and so the malloc routines don't have to dig through old released objects to find some memory for you.
    Of course as memory usage increases speed will decrease because it has to swap more and more stuff out of memory, and of course an out of memory error is difficult to handle gracefully (most applications just crash).

    So if memory isn't increasing, which you can view in top (Unix), or Task Manager (Windows) then you don't have a leak.

    If you have performance issues the best place to start is with a code profiler, which will tell you where the software is spending most of its time. Then you know which bits of code need rewriting.
     
  5. hkp819

    hkp819 New Member

    Joined:
    Dec 4, 2008
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    0
    To solve memory leaks don't use dynamic memory allocation . Of course that would take up quite a bit of unneeded space in the first place but at least the program wouldn't become slower over time. Just joking use DMA wherever you can. So much more efficient.

    I use crimson because of it's ftp saving abilities but I don't use it's debugger. I personally do my debugging all on Linux just for stability reasons. The best debugger out for Windows is Microsoft's own Visual C++. Not free by any means but nothing compares to it.
     
  6. Eldorado

    Eldorado New Member

    Joined:
    May 24, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    tommy_24, I think Deleaker can completely help you to find a memory leaks and other reasons, that can slow down your application.
    deleaker(dot)com
     

Share This Page