Help finding memory usage

  • Thread starter prathamesh.deshpande
  • Start date
P

prathamesh.deshpande

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

Thanks & regards,
Prathamesh
 
?

=?iso-8859-1?q?Erik_Wikstr=F6m?=

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

Ian Collins

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.

Why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top