Modern equivalent of BoundsChecker for Visual Studio 2008 [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
In VS6 times there was BoundsChecker from Numega. I understand it is dead now, please correct me if I am wrong. What are the reliable alternatives? Preferably free or at least with trial version available.

IMO It might be a better idea to write custom memory manager (the one that supports new/delete/malloc/free wrappers). Make a new/delete wrapper that locks unused/freed memory using VirtualProtect (yeah, I know that default allocation block will have to be PAGE_SIZE bytes large, and you'll need a lot of ram even for a small app, but that's the only disadvantage). If you are on linux, it probably have VirtualProtect alternative. In this case any outrageous out-of-bounds access will generate access violation and will be easy to track. Also use stl containers when possible - they also offer bounds checking.
This advice is based on experience - I had worked with a terribly written huge (several megabytes of code) old software that had memory leaks, accessed already freed memory from multiple threads and so on. I've spent week trying different utilities (purify, devpartner studio, aqtime etc), and although some of them provided loads of information, none were really helpful. With custom memory managment problems were eliminated in 2 days (that includes writing memory manager).
If that doesn't work for you, try compuware devpartner studio - if it is still available anywhere.

BoundsChecker is certainly not dead. "It's only mostly dead, which means partly alive" (sorry, cannot resist the Miracle Max quote from The Princess Bride.) Seriously, BoundsChecker is alive and thriving under Micro Focus stewardship. We are releasing DevPartner Studio with 64-bit application support in BoundsChecker, the .NET/native/mixed performance and coverage profilers, and the .NET memory and holistic CPU/network/disk IO performance profiler. Look for DPS 10.5 to ship on February 4, 2011. The 10.5 release integrates seamlessly with Visual Studio 2005, 2008, and 2010, but you can still use BC standalone to run Active Check against VC6 and VC2003 binaries with some success if needed. Shameless plug: I work on the DevPartner team. I am peppering SO with notes announcing the newfound relevance of DPS 10.5 for C++ and .NET app dev troubleshooting on the x64 platform. With the new pricing model where you can license just BC or just the perf profiler, DPS should be much more accessible than it ever was under Compuware stewardship and lofty pricing. Disclaimer: these are my own opinions not necessarily sanctioned by Micro Focus.

Boundschecker is not dead. I'm using it with Visual Studio 2008.
They just changed owners (Compuware to MicroFocus, to Borland), now it's called DevPartner for Visual C++ BoundsChecker Suite
Check this:
http://www.borland.com/Products/Software-Testing/Automated-Testing/Devpartner-Studio

Bounds Checker used to be my second favorite tool, after a good debugger. I found it incredibly useful. Then it got so freakin expensive that I was no longer able to justify its purchase. If you want to know why hardly anybody even knows about this great tool anymore, there's your answer.

I also work for Micro Focus, and am the main guy right now for the BoundsChecker (DPS Error Detection) runtime internals. The product is definitely not dead, but the main thing keeping it alive right now is the fanatical loyalty of certain people. Though loyalty only goes so far. We continue to have customers. If the product weren't selling at all, the company would have laid us all off long ago and canned the product.
Anyway, for those of you with questions or bugs to report, try our forum at http://community.microfocus.com/.

Purify (Plus)
http://www-01.ibm.com/software/awdtools/purifyplus/

BoundsChecker was acquired multiple times and is now here: http://microfocus.com/products/DevPartner/BoundsCheckerSuite.asp
Another option is Rational Purify (Now owned by IBM): http://www-01.ibm.com/software/awdtools/purify/
Both of these products work, kinda. But neither are a silver bullet and bring with them a non-trivial amount of work to get useful information out of them. YMMV

Related

C++ BoundsChecker followup

We've been running for years with BoundsChecker for Visual C++ 6 (I think it was BoundsChecker 5 or 6, too). We've upgaded to VS2008 (finally!), and now need a follow-up for the outdated BoundsChecker.
How's the landscape?
What tools are out there?
Any new kids in town?
Any new ideas dealing with the problems we used memory profilers for?
Your recent experiences with these tools?
Recommendations?
The main application is C++ with many COM DLL's, we are looking to track native, C++ and COM leaks and objects. Bounds Checker for that size was already a pain in performance, sorting out the slew of data and some of its limitations.
Support for managed applications (primarily C#) is required, though that may be a separate tool.
Related (but IMO incomplete) question: Modern equivalent of BoundsChecker for Visual Studio 2008
[edit]
Regardign the comment, "In modern C++, you just use self-checking types, and bounds are never broken" :
Reference counted smart pointers can have cyclic references. Interfacing COM components is inherently unsafe, as it requires a lot of manual memory management. I've had a UI-less 3rd party service leak GDI handles so it crashed our overnight tests - the vendor blamed it on a "strange" Microsoft API. I have to interface C-based libraries, I have tons of legacy code that assumes allocation trickery in the sense of Numerical Recipes is a good thing and variable names longer than 3 letters are for typists. I have code from engineers for whom a std::vector<double>::iterator looks much more scary than a double ***, good luck developing and testing these without a solid background in signal processing.
So unless you come here, rewrite and encapsulate the core of a million lines of code in fool-proof C++ classes and make sure a few dozen products still work as before, keep your smart-assery to yourself. I wish I wouldn't need a memory checker, but I do. Thank you.
Disclaimer and warning: I work for Micro Focus, owner of the DevPartner Studio and BoundsChecker products.
BoundsChecker 10.5, part of DevPartner Studio 10.5 (though you can buy it by itself), supports Visual Studio 2005, 2008 and 2010 unmanaged code for 32 and 64 bit applications in essentially the same way it supported 32 bit applications on Visual Studio 6.0. While enhancing it to support X64 applications, we found and fixed quite a few very old problems, and made a start at working in spite of the .NET 4.0 code present in some VS 2010 applications. I say "in spite of" because .NET 4.0 turns out to do a lot of very nasty things in the process space, doing some things that Microsoft warns everybody else not to do, and has a certain amount of built-in resistance to tools like BoundsChecker, which are essentially gigantic viruses.
Anyway, since that release (February 4th), we have updated it to work on Windows 7 SP1 (which isn't quite public yet), and as far as BoundsChecker is concerned, we work with Visual Studio 2010 SP1 as well. We also discovered a nasty .NET 4.0 trap, and figured out to prevent it from taking us down. These enhancements and fixes will be available in our next public update, hopefully within the next month or so.
I have a massive application (here at work), and the new bounds checker 10.5 (supports 64 bit apps now) pretty much works with it. The trick Max is not to turn on all the checker features of devpartner bounds checker at once. Turn on just memory leaks, or turn on just some other feature, then run your app. And by all means exclude modules you don't need. There are quite a few things you can use to tune your settings so it goes faster. But yes, it does take a performance hit. But that is the name of the ballgame.
Intel's Parrallel inspector gave us thousands and thousands of false positives. Didn't use it.
Purify only works on 32 bit apps. i.e. small 32 bit native apps. Forget about using it with a managed C++ app.
And just for the record, if you have a large 32 bit app, memory analysis tools in general won't work very much, because of the massive memory overhead. And since you have very limited memory in a 32 bit address space, you quickly run out of room, and the tools fail.
We evaluated Boundschecker, Intel's Inspector and Purify.
They were all more or less crap.
For our main application, BoundsChecker would not start it after many hours; it only worked for a couple of smaller applications; but find a couple of things (I think we're still in contact with them to figure things out)
Intel's Inspector works, but does not instrument the code, it runs on the executable only (maybe works better when used with the whole suite of Intel products).
Purify failed miserably; we were never able to use it.
We're still in limbo about that.
Max.
Boundschecker: I just bought a (&(^ subscription which only entitles me to use the damned product for 99 days, so I'm pretty damned upset about that) but anyhow I was having big memory troubles and thought I ought to run this thing. It seems to catch lots of interesting things, but is so damned slow that, well put it this way: my appliciation is still in the DLL init code; it has been running for at least a couple hours, and so far it hasn't even gotten as far as the app does normally in the first COUPLE SECONDS. Boundschecker used to be 'the shit' back in numega days, but it seems like it is really another technological orphan being peddled by an opportunitstic business entity, like borland compilers.
So I really like it when it works, it has lots of great info. I just need to see if I will be able to actually get any decent results. It is currently using 4+ GB of RAM and hasn't even started up fully yet. Since I use win7/64 with a crippled home edition which will only recognize 12GB, I may run out of memory before anything really interesting happens. And it will be sometime a few days from now...

Visual C++ - Memory Leak Detection

Any suggestions? This SO post talks about Visual Leak Detector, but I'm looking for other tools. Also, please don't recommend this.
I've used Visual Leak Detector quite recently and it works pretty well. It's very simple to build it in (just include vld.h) and doesn't require any instrumentation. I found that I needed to write a couple of scripts though to parse the output into something more useful for my purposes (it is crying out for a decent GUI). Note the new website -- the project is being actively maintained on Codeplex -- the Codeproject link is very old.
Try Deleaker or DevPartner, these both are good enough.
update:
C++ Memory Validator, works fine and fairly priced.
If you can afford some money use the Intel Parallel Inspector (https://www.intel.com/content/www/us/en/developer/tools/oneapi/inspector.html).
It doesn't require any code modifications and provides good reports.
I had to look for good tools to do that in work and that's the best tool (by far) that I found.
As suggested by Noah Roberts, i too felt Memory validator as the best tool for detecting leaks in Visual studio.
Purify also works.
Asked a similar question not long ago but related to 2010 specifically: VS2010 profiler/leak detection
If you're not using 2010 you might consider AQtime. It's not too terrible most the time. There are times thought when it fails to find an object related to the leak and just says "crt memory" or whatever.
Another I recently tried is called "Memory Validator". Not exactly a nice interface but it does seem to work, and work with 2010 too (just doesn't have any other kind of profiling in it, which is something I expect in a commercial tool like that).
Maybe GlowCode as was mentioned in other, similar questions, on SO when I searched before asking.
There is also application verifier. It can track a whole bunch of other issues as well apart from leaks like places where you forget to free win32 objects such as handles etc ...
The MSDN link is: http://msdn.microsoft.com/en-us/library/ms220948(VS.80).aspx
Jacob, the BoundsChecker tool inside DevPartner Studio contains two types of leak detectors for VC++. The uninstrumented version will tabulate leaks at process shutdown. The compile time instrumented detector will break on leaks at the time the leak occurrs showing both the current call stack at the point of leakage, and the allocation stack trace showing where the leaking memory was allocated. The 64-bit version of DPS and BoundsChecker 10.5 ships February 4, 2011 with x64 application support for Visual Studio 2010, 2008, and 2005. We also have a new pricing model so you can license just the BoundsChecker features and ugrade to the full DPS suite only if you find you need the other profilers or static analysis capabilities later on. Be sure to haggle with your sales rep too. Paying list price is like paying sticker price on a new car. Shameless plug: I work on the DevPartner team. DPS 10.5 represents my team's biggest release of tech capability since Compuware closed the NuMega lab. Please evaluate it for your own application and tech stack when 10.5 goes live. Cheers. Matt Schuetze, DevPartner Product Owner (and yes that means PO in normal Scrum team roles.)
VLD cannot be trusted for more serious projects.
Intel has a good tool called Inspector.
After 3 days searching for a good tool to find leaks on x64 binaries with C++ in Visual Studio, this is the only good option I found.
Try Dr.Memory.
They have proper visual studio integration and documentation is excellent.
Easy to use too.
https://sourceforge.net/projects/diagnostic/
http://diagnostic.sourceforge.net/index.html
I had tried so many memory leak detectors that it's difficult to count them all. Some of them crashed, some of them produced invalid results, some of them simply did not help. Eventually I've made my own leak detector, but invested so much effort into it - so made it non-free for time being. Managed / native / 32 & 64-bit architectures supported.
If you ever want to develop this tool further, please feel free to contact me.

What are some good profilers for native C++ on Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for a profiler to use with native C++. It certainly does not have to be free, however cost does factor into the purchase decision. This is for commercial work so I can't use personal or academic licensed copies.
The key features I'm looking for are:
Process level metrics
Component level metrics
Line-level metrics
Supports Multi-threaded code
Usability
Cost
Visual Studio 2005 Professional support required (VS 2008 Professional support highly
desirable)
I've used Intel's VTune and Compuware's Devpartner Performance Analysis Community Edition.
VTune seemed very powerful but it has a steep learning curve. It also is very "modular" so you have to figure out what parts are you need to buy.
DevPartner PACE was pretty easy to use and provides all of the key features however it's only a 45-day trial. The licensed version (DevPartner for Visual C++ BoundsChecker Suite) is about $1400 a seat, which is doable but a bit high imo.
What are some good profilers for native C++ and WHY?
See also:
What's Your Favorite Profiling Tool For C++
On Windows, GlowCode is affordable, fairly easy to use, and offers a free trial so you can see if it works for you.
Try Intel Parallel Studio. Currently, it's in beta, but the name Intel says it all.
http://www.intel.com/go/parallel
Many people are not aware but MSFT is making a great progress putting the best possible tools for improving performance in the hands of devlopers for free :-). They are exposing to all of us the internals of Windows tracing: ETW.
perftools
It is part of the new windows SDK for server 2008 and Vista. Simply impressive and must to download if performance analysis and profiling under Windows is your goal (regardless of language).
Check the documentation here before you decide to download it:
msdn doc
Just found Luke StackWalker on SourceForge (http://lukestackwalker.sourceforge.net/).
Unfortunately it does not have a 'focus on sub tree', but it remains handy to use, uses the symbol server (I suggest you set it up immediately if you don't have it yet), offers a graphical visualisation, ...
The down side is that it doesn't show the accumulated times (samples) of the child functions.
Another alternative is "Very Sleepy" (http://www.codersnotes.com/sleepy). It can show the accumulated times of the children, but unfortunately it doesn't use the symbol server.
CodeXL may also be worth looking at, it can run on both Linux and Windows, although it is mainly dedicated to OpenGL/OpenCL debugging and profiling there is a time based sample option for CPUs under the profiling section which maybe helpful. It's also free and works as long as pdb files are available (well on windows, I don't know how it works on Linux) (even for release builds with pdb).
Definitely Visual Studio Team System. By far.
I just finished the first usable version of CxxProf, a portable manual instrumented profiling library for C++.
It fulfills your requirements:
Profiles multithreaded applications
Support for profiling multiple processes throughout the same network is on the way
It is written with the best usability and easiest integration in mind
It's free as in beer and free as in speech
It will work with VS05,08,10,12 and 13. As well as with g++ on Linux. It's currently tested with VS 2013 Express.
See the project wiki for more info.
Disclaimer: Im the main developer of CxxProf
I wrote an open source lightweight win32/64 profiler, support both CPU and memory profiling,
it's kind of similar with VS profiler, but with unique feature like flame graph of CPU and
memory data. it's here: dprofiler

Decent profiler for Windows? [duplicate]

This question already has answers here:
What are some good profilers for native C++ on Windows? [closed]
(8 answers)
Closed 9 years ago.
Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows.
I've tried the profiler in VS Team Suite and was not overly impressed, and was wondering if there were any other good ones.
[Edit: Erk, i forgot to say this is for C/C++, rather than .NET -- sorry for any confusion]
For Windows, check out the free Xperf that ships with the Windows SDK. It uses sampled profile, has some useful UI, & does not require instrumentation. Quite useful for tracking down performance problems. You can answer questions like:
Who is using the most CPU? Drill down to function name using call stacks.
Who is allocating the most memory?
Outstanding memory allocations (leaks)
Who is doing the most registry queries?
Disk writes? etc.
I know I'm adding my answer months after this question was asked, but I thought I'd point out a decent, open-source profiler: Very Sleepy.
It doesn't have the feature count that some of the other profilers mentioned before do, but it's a pretty respectable sampling profiler that will work very well in most situations.
Intel VTune is good and is non-instrumenting. We evaluated a whole bunch of profilers for Windows, and this was the best for working with driver code (though it does unmanaged user level code as well). A particular strength is that it reads all the Intel processor performance counters, so you can get a good understanding of why your code is running slowly, and it was useful for putting prefetch instructions into our code and sorting out data layout to work well with the cache lines, and the way cache lines get invalidated in multi core systems.
It is commercial, and I have to say it isn't the easiest UI in the world.
AMD's CodeAnalyst is FREE here
We use both VTune and AQTime, and I can vouch for both. Which works best for you depends on your needs. Both have free trial versions - I suggest you give them a go.
The Windows Driver Kit includes a non-instrumenting user/kernel sampling profiler called "kernrate". It seems useful for profiling multi-process applications, applications that spend most of their time in the kernel, and device drivers (of course). It's also available in the KrView (Kernrate Viewer) and Windows Server 2003 Resource Kit Tools packages.
Kernrate works on Windows 2000 and later (unlike Xperf, which requires Vista / Server 2008). It's command-line based and the documentation has a somewhat intimidating list of options. I'm not sure if it can record call stacks or just the program counter. If you use a symbol server, make sure to put an up-to-date dbghelp.dll and symsrv.dll in the same directory as kernrate.exe to prevent it from using the ancient version of dbghelp.dll that is installed in %SystemRoot%\system32.
I have tried Intel's vtune with a rather large project about two years ago. It was an instrumenting profiler then and it took so long to instrument the DLL that I was attempting to profile that I eventually lost patience after an hour.
The one tool that I have had quite good success and which i would highly recommend is that of AQTime. It not only provides excellent performance profiling resources but it also doe really good memory profiling which has been of significant help to me in tracking down memory leaks.
Luke Stackwalker seems promising -- it's not as polished as I'd like, but it is open source and it does do something that seems very close to what #Mike Dunlavey keeps saying we ought to do. (Of course, it then tries to smoosh it all down into the typically-unhelpful call graphs that Mike is so weary of, but it shouldn't be too hard to fix that with the source as our ally.)
It even seems to count time spent waiting in the kernel, as far as I can tell...
I'm not sure what a non-instrumenting profiler is, but I can say for .NET I love RedGate's ANTS Profiler. Version 3 beats the MS version for ease of use and Version 4, which allows arbitrary time slices, makes MS look like a joke.

What's the best free C++ profiler for Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune, but it's not free either.
CodeXL has now superseded the End Of Line'd AMD Code Analyst and both are free, but not as advanced as VTune.
There's also Sleepy, which is very simple, but does the job in many cases.
Note: All three of the tools above are unmaintained since several years.
Very Sleepy is a C/C++ CPU profiler for Windows systems (free).
Proffy is quite cool: http://pauldoo.com/proffy/
Disclaimer: I wrote this.
There is an instrumenting (function-accurate) profiler for MS VC 7.1 and higher called MicroProfiler. You can get it here (x64) or here (x86). It doesn't require any modifications or additions to your code and is able of displaying function statistics with callers and callees in real-time without the need of closing application/stopping the profiling process.
It integrates with VisualStudio, so you can easily enable/disable profiling for a project. It is also possible to install it on the clean machine, it only needs the symbol information be located along with the executable being profiled.
This tool is useful when statistical approximation from sampling profilers like Very Sleepy isn't sufficient.
Rough comparison shows, that it beats AQTime (when it is invoked in instrumenting, function-level run). The following program (full optimization, inlining disabled) runs three times faster with micro-profiler displaying results in real-time, than with AQTime simply collecting stats:
void f()
{
srand(time(0));
vector<double> v(300000);
generate_n(v.begin(), v.size(), &random);
sort(v.begin(), v.end());
sort(v.rbegin(), v.rend());
sort(v.begin(), v.end());
sort(v.rbegin(), v.rend());
}
Microsoft has the Windows Performance Toolkit.
It does require Windows Vista, Windows Server 2008, or Windows 7.
Another profiler is Shiny.
​​​​​
I highly recommend Windows Performance Analyzer (WPA) part of the Windows Performance Toolkit. The command line Windows Performance Recorder (WPR) tool records Event Tracing for Windows (ETW) logs that can be analyzed later using the Windows Performance Analyzer tool. There are some great tutorials on learning how to use the tool.
wpr.exe -start CPU
...
wpr.exe -stop output.etl
wpa.exe output.etl
I use AQTime, it is one of the best profiling tools I've ever used.
It isn't free but you can get a 30 day trial, so if you plan on a optimizing and profiling only one project and 30 days are enough for you then I would recommend using this application. (http://www.automatedqa.com/downloads/aqtime/index.asp)
Please try my profiler, called cRunWatch. It is just two files, so it is easy to integrate with your projects, and requires adding exactly one line to instrument a piece of code.
http://ravenspoint.wordpress.com/2010/06/16/timing/
Requires the Boost library.
I used Luke Stackwalker and it did the job for my Visual Studio project.
Other interesting projects are:
Proffy
Dyninst
I've used "TrueTime - part of Compuware's DevPartner suite for years. There's a [free version](you could try Compuware DevPartner Performance Analysis Community Edition.) available.
I use VSPerfMon which is the StandAlone Visual Studio Profiler. I wrote a GUI tool to help me run it and look at the results.
http://code.google.com/p/vsptree/
You can use EmbeddedProfiler, it's free for both Linux and Windwos.
The profiler is intrusive (by functionality) but it doens't require any code modifications. Just add a specific compiler flag (-finstrument-functios for gcc/MinGW or /GH for MSVC) and link the profiler's library. It can provide you a full call tree or just a funciton list. It has it's own analyzer GUI.