Yochai Timmer
Yochai Timmer

Reputation: 49221

VS2010 - How can I view the program's memory usage?

I'm developing a program in C++.

I have a database class, and I want to know how much space it takes up in memory.

I guess it will pretty hard to analize the object itself at runtime (pointers and such).
But if I can check the size of memory usage before the object is created and after, it will give me a good estimate of the database object's total size.

Now, besides the task-manager....
Is there some window or addin to Visual Studio 2010 that will let me see a detailed memory usage view of my application ?

And if there's none for unmanaged code, is there something like this for managed .Net code ?

Thanks

Upvotes: 0

Views: 2196

Answers (3)

OregonGhost
OregonGhost

Reputation: 23749

For professional development, I recommend AutomatedQA's AQTime. It's a full-featured profiler suite for most common Windows compilers, including several C++ and .NET compilers. And it integrates with Visual Studio and other IDEs. I couldn't live without the performance and allocation profilers.

Run the allocation profiler, and you can not only see the live memory usage, but also the size and count of any object.

Upvotes: 1

Kirill V. Lyadvinsky
Kirill V. Lyadvinsky

Reputation: 99555

You could create memory dump before and after you have created the object using UMDH tool. UMDH also can show you the difference between two memory dumps.

Upvotes: 1

thumbmunkeys
thumbmunkeys

Reputation: 20764

Use Sysinternals process explorer, right click the program in the process list and view the properties. It gives you a bit more details than standard task manager.

Upvotes: 0

Related Questions