[vtkusers] Memory leak

Jothybasu Selvaraj jothybasu at gmail.com
Tue May 15 10:19:02 EDT 2012


Hi all,

I have a pipeline like this, every time I call this function the memory
increases ~10MB. How can I fix this?

I have a imgData already instantiated like this

vtkSmartPointer<vtkImageData>img=
     vtkSmartPointer<vtkImageData>::New();

vtkSmartPointer<vtkXMLImageReader>rd=
     vtkSmartPointer<vtkXMLImageReader>::New();
rd->SetFilename("filename");
rd->Update();

img=rd->GetOutput();


//Now I repeat this function several times

   vtkSmartPointer<vtkImageShiftScale>scaler=
           vtkSmartPointer<vtkImageShiftScale>::New();
   scaler->SetInput(img);*//is this correct way of doing?*

   scaler->SetScale(0.5);//Multiply
   scaler->SetOutputScalarTypeToDouble();

   //scaler->ReleaseDataFlagOn();//Tried with this too
   scaler->Update();

   img=scaler->GetOutput();*//is this correct way of doing?*

I am beginner in C++, so I am expecting some silly mistakes.


Thanks
--
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120515/c23fd78e/attachment.htm>


More information about the vtkusers mailing list