Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - Re: [systemc-forum] Memory meter Message Thread: Previous | Next
  • To: Lucas Giraudo <lucas.giraudo@xxxxxxxxxxxxxxx>
  • From: "Philipp A. Hartmann" <philipp.hartmann@xxxxxxxx>
  • Date: Sat, 13 Nov 2010 18:02:54 +0100
  • Cc: systemc-forum@xxxxxxxxxxxxxxxxx
Send Email to
Send new message
Reply to this message

On 12/11/10 23:19, Lucas Giraudo wrote:
> Hi, I'm trying to determine the memory consumed by the different class of a
> program in C++, Have you any software to measure this?

unfortunately, it's not exactly clear to me what you want to measure.
The "memory consumed by a class" might be as easy as the "sizeof"
operator in C++:

#include <cassert>
struct foo { double d; };
int main()
  assert( sizeof( foo ) == sizeof( double ) );

But this of course only covers the "static size" of your classes.  If
they allocate additional memory during runtime, this can not be
determined by sizeof.

If you want to look at the overall memory/heap consumption of your
program over the time, you can have a look at the Valgrind tool suite.
IIRC, they have a heap profiler.

Greetings from Oldenburg,

Philipp A. Hartmann
Hardware/Software Design Methodology Group

OFFIS Institute for Information Technology
R&D Division Transportation · FuE-Bereich Verkehr
Escherweg 2 · 26121 Oldenburg · Germany
Phone/Fax: +49-441-9722-420/282 · PGP: 0x9161A5C0 ·

Attachment: signature.asc
Description: OpenPGP digital signature

By Date: Previous | Next Current Thread By Thread: Previous | Next