[Insight-developers] memory probe test

Nicholas Tustison ntustison at gmail.com
Fri Aug 13 06:47:51 EDT 2010


Hi Emmanuel,

I hadn't thought of that.  Thanks for the suggestion---I'll certainly give it a try.

Nick

On Aug 13, 2010, at 5:41 AM, Emmanuel Christophe wrote:

> Hi Nick,
> This could be coming from compiler optimization: as foo is not used,
> the initialization could be reported later. It might be worthwhile to
> try to do some operations on foo between the start and stop.
> 
> Emmanuel
> 
> 
> On Fri, Aug 13, 2010 at 09:13, Nicholas Tustison <ntustison at gmail.com> wrote:
>> Hi Developers,
>> 
>> I posted a question a couple days ago about the itkTimeAndMemoryProbeTest on the users' list but after doing some more digging, I was hoping somebody on the developer's list could tell me where my thinking is incorrect.  Four different memory situations from 1KB to 1024 KB (see below) are tested.  However, if you look at the output from different platforms on the dashboard, the reported values are mostly 0 (which is what I see on my machines) with the occasional exception which oftentimes does not match the testing value.  Perhaps I'm missing something but are these zero values that are being reported for this test correct?  Also, even if the output is 0 for all test cases, shouldn't the occasional nonzero values throw an exception?
>> 
>> Thanks,
>> Nick
>> 
>> 
>> 
>> 
>> int itkTimeAndMemoryProbeTest(int argc,char* argv[])
>> {
>>  (void)argc;
>>  (void)argv;
>> 
>>  itk::TimeProbe timeProbe;
>>  itk::MemoryProbesCollectorBase memoryProbes;
>> 
>>  timeProbe.Start();
>> 
>>  memoryProbes.Start("1KB Test");
>>  char* foo = new char[1*1024];
>>  memoryProbes.Stop("1KB Test");
>> 
>>  memoryProbes.Start("70KB Test");
>>  char* foo2 = new char[70*1024];
>>  memoryProbes.Stop("70KB Test");
>> 
>>  memoryProbes.Start("170KB Test");
>>  char* foo3 = new char[170*1024];
>>  memoryProbes.Stop("170KB Test");
>> 
>>  memoryProbes.Start("1024KB Test");
>>  char* foo4 = new char[1024*1024];
>>  memoryProbes.Stop("1024KB Test");
>> 
>>  memoryProbes.Report( std::cout );
>>  memoryProbes.Clear();
>> 
>>  memoryProbes.Start("Release Test");
>>  delete[] foo;
>>  delete[] foo2;
>>  delete[] foo3;
>>  delete[] foo4;
>>  memoryProbes.Stop("Release Test");
>> 
>>  memoryProbes.Report( std::cout );
>> 
>>  timeProbe.Stop();
>>  std::cout<<" The test has last "<<timeProbe.GetMean()<<timeProbe.GetUnit()<<std::endl;
>> 
>>  return EXIT_SUCCESS;
>> }
>> 
>> _______________________________________________
>> 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://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-developers
>> 



More information about the Insight-developers mailing list