views:

941

answers:

2

After reading an article in the most recent issue of MSDN magazine, I wanted to try using VADump to break down the memory usage of some applications I've written.

The only copy of the executable on my PC is at:

c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin\winnt\vadump.exe

No matter what combination of arguments I give VADump, it gives back the error:

OpenProcess Failed c0000034

Googling for this turns up a few others who've had the same issue, but none of these posts had resolutions (or even replies!) that I could find.

This machine is running WinXP SP2 with VS2005 and VS2008 installed.

VADump looks like quite a useful tool and I'd really like to try it. Hopefully this will work on another PC in the office, but I'd still like to get it working on mine.

Any ideas?

+1  A: 

In the end, I managed to download a newer version of VADump from here:

http://go.microsoft.com/fwlink/?LinkId=149683

It runs now, but not without spewing out all manner of garbage before the useful stuff...

C:\Program Files\Resource Kit>VADUMP.EXE -sop 7240
Error: Heap ShareCount > 1, 0x00271000
Error: Private ShareCount > 1,  0x3400000
Error: Private ShareCount > 1,  0x3402000
Error: Private ShareCount > 1,  0x3403000
Error: Private ShareCount > 1,  0x3404000
Error: Private ShareCount > 1,  0x3405000
Error: Private ShareCount > 1,  0x3406000
Error: Private ShareCount > 1,  0x3408000

...etc...

Catagory                        Total        Private Shareable    Shared
                           Pages    KBytes    KBytes    KBytes    KBytes
      Page Table Pages        49       196       196         0         0
      Other System           127       508       508         0         0
      Code/StaticData       6731     26924      3252      3876     19796
      Heap                   768      3072      3072         0         0
      Stack                   74       296       296         0         0
      Teb                     22        88        88         0         0
      Mapped Data            221       884         0        92       792
      Other Data            4038     16152     16148         4         0

      Total Modules         6731     26924      3252      3876     19796
      Total Dynamic Data    5123     20492     19604        96       792
      Total System           176       704       704         0         0
Grand Total Working Set    12030     48120     23560      3972     20588

If you're interested in understanding the allocation of memory in your application, I recommend reading the article I pointed to in the original question.

Drew Noakes
A: 

My suggestion is to CD to its own directory first.

To illustrate:

C:\>"c:\Program Files\Resource Kit\VADUMP.EXE" -s -p 7404
OpenProcess Failed c0000034

C:\>cd "c:\Program Files\Resource Kit"

C:\Program Files\Resource Kit>VADUMP.EXE -s -p 7404

Total  Image Commitment 229154816
    READONLY:           36380672
    READWRITE:           4022272
...
Bryan