I have created an application in C++ using visual studio. And as per my application it should take very less memory but it is taking very much memory. So, now I want to know memory map function wise. Is there any way in Visual Studio to generate memory map or any other tool or any other way to generate memory map. Please Reply soon.
Thanks in Advance.
Mayank
You could try using Visual Leak Detector. It will not give you function wise memory usage but will highlight leaked memory traces in the debugger output. You'll have to play around a bit go get used to it.
I believe it is more operating system specific than language or compiler specific.
On Linux, you can read (from inside your process) the
/proc/self/maps
to understand the memory map of your application.The above example shows the memory map of the process executing the
cat
command.EDIT
Don't expect to find memory use by function, since memory usage of a given data is a global property of the program (so the very notion of memory usage per function has no sense). You could use some garbage collection technique. And you could (at least on Linux) use Boehm's garbage collector, or write your own GC, or hunt memory leaks with valgrind (or a similar program for your system).
You have to find out if your operating system gives you an equivalent facility. (I don't know and don't use Windows, so I cannot help more)