On 18 Maj, 14:29, prathamesh.deshpa...@gmail.com wrote:
Hi All,
I have a program written in VC++. I want to calculate the memory
consumed by each of the individual functions within the program. So
can anyone suggest how this could be done? I need to do this without
overloading my new and delete operators. I also tried using the
windows monitoring service but could not benefit much from it. Also
please suggest if there are in any built windows api to acheive this
There might be some program that can be used to calculate the memory
used by each function but there are some problems with it. One is that
a function can allocate memory dynamically and the amount allocated
can be determined by a parameter passed, so you can't really tell how
much it takes until you know it's parameters.
Another problem is that due to alignment the amount of memory used on
the stack can vary depending on the compiler-flags used and
architecture you compile on.
If you tell us why you want this someone might be able to give a
better answer. If you are looking to optimize the memory usage of the
program then perhaps a profiler might be useful.
--
Erik Wikström