[Insight-users] Help to understand MemoryProbesCollectorBase

Monica Hernandez Gimenez mhg at unizar.es
Mon Feb 1 11:10:11 EST 2010


Dear ITK users,

I am trying to use the class itk::MemoryProbesCollectorBase in order to
track the memory usage of
my ITK based code. I am getting some weird results, for example, my code
takes 1Gb of memory
usage (using top command). However the report does not provide such
information. In addition
I am getting negative results of memory usage in specific locations of
my code.

I used this code below in order to allocate some memory and see if the
memory collector works fine
for a simpler code. However, the report says that the process takes 0 Kb
of memory usage.
I am working on a Suse 11.0 64 bits machine.

This has taken me to these questions

1) Is there any known bug for 64 bits machine?
2) Does itk::MemoryProbesCollectorBase works only for itk related classes?
3) Does the amount of memory indicate the memory allocated between Start
and Stop orders?
4) Does the negative amount of memory indicate deallocation of objects?

Could somebody help me?
Thank you!

int main( int argc, char **argv )
{  
  itk::MemoryProbesCollectorBase mcollector;

  mcollector.Start( "Update" );

  size_t numberOfBytes = atol(argv[1] );
  char * buffer = new char[numberOfBytes];

  mcollector.Stop( "Update" );
  mcollector.Report();

  delete [] buffer;

  return 0;
}





More information about the Insight-users mailing list