tools to determine memory leak in a c/c++ code [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
On the unix environment, are there any tools which can easily analyse the code and mention there is a chance of memory leakage in certain sections of the code.
HPUX/AIX/Solaris

If you're talking about static analysis then there's cppcheck (among many others)
If you're talking about a runtime checker (which will be way more accurate and reliable than static analysis) there's valgrind
There's loads of other tools available. Check out the links above for more information
Purify will work on AIX (though it's not free.
HP has the wdb debugger, and it's capable of detecting memory leaks.

I use Insure and it works well. For more information use
http://www.parasoft.com/jsp/products/article.jsp?articleId=530

Although not a specialized tool for detecting memory leaks another option is the Boehm-Demers-Weiser garbage collector available from HP Labs.
It works as a replacement for new and malloc.
Here are instructions to use it as a leak detector. It is, or was, used by Mozilla as a leak detector for Firefox. If i recall correctly it was also used by Mono and DotGNU Portable.NET as a gc.

I also use this tool regularly and it has solved many problems for me instantly.
This is one tool which I have created for identifying memory leaks in solaris unix.
Here it is. The way to run it also mentioned here clearly.

Related

Create crash dump report for a C++ application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Sometimes it happens that your distributed application crashes on customer machines. What you obtain as an info from the customer is that the application simply crashed "doing something": no way to understand where the bug was in your code. Is there a library/add-on to be linked to your application that can create a backtrace file/crash dump report so that it could be sent by the customer to better understand what you normally see in the Visual Studio call stack helping understanding where the bug is?
see google: https://code.google.com/p/google-breakpad/
Description from the website:
Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact "minidump" files, send them back to your server, and produce C and C++ stack traces from these minidumps. Breakpad can also write minidumps on request for programs that have not crashed.
https://code.google.com/p/google-breakpad/wiki/GettingStartedWithBreakpad
There are a few third party solutions available that provide a library of functions to trap crash data. A simple google search should suffice. However, depending on your budget, the easiest solution is to create a Microsoft WER account. WER has advantages over the other solutions because it is part of the OS and it exposes several functions that allow you to tailor the crash data collection.

Visual C++ examine object instances size in the process memory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I wish to know what is the overall memory consumed in runtime by all instances of a specific type.
I mean,I am using process explorer to see how much memory consumes specific process.But I would also like to know what objects and how much memory they consume inside the process.
Some memory leas detector tools can do this, such as Memory Validator. It is not free, you can download a trial version and try it.
If you just want to find memory leaks, DebugDiag from MS is a good choice.
Another way is to override new and delete for the object you want to monitor, thus you can track the memory usage.

Manual Decompilation References [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for book titles or papers about how to decompile X86 Disassembly into C/C++ code MANUALLY.
Well , I know about many tools that do the job , but I think doing it manually is more efficient even if it's a slow process.
If you are VERY used to looking at disassembly from a particular compiler, you MAY be able to come up with decent C or C++ code. But it's a TERRIBLY slow process even then. Just taking one small function (say a for-loop, a couple of if-statements and some basic math) and reconstructing it back into source code can take half an hour for me, and I don't think I'm terribly bad at it. Of course, one of the main points is identifying commonly used algorithms, such as linked lists, binary trees, string management, vector management, etc.
Doing it by machine will give you a lot of the work done for you, but even then, it can take days to do even a few hundred lines of orginal C++ code into something that is actually readable.

A C++ source code analyzer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Could you suggest some open source tools that analyze C++ code and checks the following rules:
naming conventions,
file inclusions,
function design,
data types,
flow control,
memory allocation,
file handling,
portable code,
runs under Solaris or SUSE
http://www.google.com/search?q=misra+checker
Of course, if the rules you're trying to enforce don't exactly match someone else's idea of a coding standard, no existing tool is going to work.
It is still in early development (especially for C++) but its improving rapidly and is a really interesting open source project in a vibrant community. So see if the CLang Static Analyzer does what you need.
I have used coverity (http://coverity.com/)in my organization. It does static bug check analysis and I found it to be very useful. It is highly customization and provides a number of checks. I am not entirely sure if it works on solaris or not but I would recommend checking it out.

What are some good tools for measuring memory allocations on Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have an application that keeps using up more and more memory as time goes by (while actively running), but there are no leaks. So I know the program isn't doing something totally wrong, which would be easy to find.
Instead I want to track allocations so I can start tracking down the issue, and on a Mac I'd use Instruments, which gives a detailed profile of what objects have been allocated, and by whom, but on Windows what would I use?
Currently I'm working with C/C++ on Windows XP, using VS2005. So any tools for this setup would be great, and hopefully tools that are free or at least provide a few weeks of trial, because it'll take a while to complete any purchase (corporate stuff) if necessary, and I have deadlines.
Thanks!
Edit: I'm using VLD, so I know the program has no Leaks, but it seems to be hogging more memory than needed, and not returning it, so I need to track allocations, not leaks.
Memory validator would be ideal for you.
http://www.softwareverify.com/cpp/memory/index.html
Glowcode is here. It has the worst user interface in the world. The internals have the stuff though, if you have the patience to struggle through the horror that is trying to get it to work right. There is a 21 day free trial. I've found it to be a lifesaver, but you really have to want to find that bug.
Visual Studio Enabling Memory Leak
Detection
The primary tools for detecting memory
leaks are the debugger and the CRT
debug heap functions. To enable the
debug heap functions, include the
following statements in your program:
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
http://msdn.microsoft.com/en-us/library/e5ewb1h3(VS.71).aspx