[Insight-users] Help to understand MemoryProbesCollectorBase

Luis Ibanez luis.ibanez at kitware.com
Fri Feb 5 14:26:10 EST 2010


Hi Monica,


I managed to replicate the problem that you are reporting.


Then implementation of the memory probes is very platform
dependent.

It is surprising how difficult it is to answer that simple question
in a portable way.

The final implementation of the probe relies on the code in

      Insight/Utilities/kwsys/SystemInformation.cxx

In order to track the problem we may have to go down the
trace of the logic in SystemInformation...

Could you please log a bug about this issue ?
http://public.kitware.com/Bug/my_view_page.php



      Thanks


              Luis



----------------------------------------------------------------
On Mon, Feb 1, 2010 at 11:10 AM, Monica Hernandez Gimenez <mhg at unizar.es> wrote:
> 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;
> }
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list