Using VADump to track memory usage - OpenProcess Failed c0000034

让人想犯罪 __ 提交于 2019-12-19 04:14:35

问题


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:


VADump is old, circa 2000. A graphical equivalent of the tool is actively maintained, called VMMap: http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx.




回答2:


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.




回答3:


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
...


来源:https://stackoverflow.com/questions/955034/using-vadump-to-track-memory-usage-openprocess-failed-c0000034

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!