Mail Archives: djgpp/1998/11/08/23:17:01
Christian Herold wrote:
>
> Hello!
>
> Is there a utility wich shows me how much memory my c++ (including
> variables and consts) takes?
Hmm... you can find the size of all code and statically allocated data
with the `size' command on your executable. The fields, in bytes, are
as follows:
`text' Code and most read-only data (like string literals) (in C anyway,
C++ may be different)
`data' Read/write initialized data (like `char a[5] = "Foo";');
`bss' Read/write uninitialized data (like `char a[5];')
`dec' Total in decimal
`hex' Total in hex
As for dynamically allocated data, it may be best to use a memory
analysis/debugging package like MSS, which will give you more statistics
about dynamic memory usage than you ever wanted. :)
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -