[vtkusers] VTK not releasing memory, including minimal example.
Bill Lorensen
bill.lorensen at gmail.com
Sun Sep 23 14:09:39 EDT 2012
How big is the input image and how many triangles is ContourFilter
generating?
On Sun, Sep 23, 2012 at 2:05 PM, P.J.Schaafsma <jetze.schaafsma at gmail.com>wrote:
> ...and the VTK_DEBUG_LEAKS output. Seems to work. Everything is cleaned up.
> Still, memory use is > 100Mb during the event loop in this simple case.
>
> Used source:
>
>
> int main()
> {
> vtkXMLImageDataReader *reader = vtkXMLImageDataReader::New();
> //reader->SetFileName("e:\\data\\volume\\manix_low.vti");
> reader->SetFileName("/media/Data/data/volume/manix_low.vti");
>
> vtkContourFilter *contour = vtkContourFilter::New();
> contour->SetInputConnection(reader->GetOutputPort());
> contour->SetValue(0, 800);
>
> vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
> mapper->SetInputConnection(contour->GetOutputPort());
> mapper->Update();
>
> vtkActor *actor = vtkActor::New();
> actor->SetMapper(mapper);
>
> vtkRenderer *renderer = vtkRenderer::New();
> renderer->AddActor(actor);
>
> vtkRenderWindow *render_window = vtkRenderWindow::New();
> render_window->AddRenderer(renderer);
>
> vtkInteractorStyleTrackballCamera *style =
> vtkInteractorStyleTrackballCamera::New();
>
> vtkRenderWindowInteractor *interactor =
> vtkRenderWindowInteractor::New();
> interactor->SetInteractorStyle(style);
> interactor->SetRenderWindow(render_window);
> interactor->Initialize();
>
> ////// Comment this out and save memory
> render_window->Render();
> //////
>
> renderer->RemoveActor(actor);
> render_window->Render();
>
> actor->Delete();
> mapper->Delete();
> contour->Delete();
> reader->Delete();
>
> interactor->Start();
>
> render_window->RemoveRenderer(renderer);
> interactor->SetInteractorStyle(0);
>
> style->Delete();
> interactor->Delete();
> renderer->Delete();
> render_window->Delete();
>
> // Just checking debug leaks works
> vtkActor *a = vtkActor::New();
>
> return 0;
> }
>
> Output
>
>
> vtkDebugLeaks has detected LEAKS!
> Class "vtkMatrix4x4" has 2 instances still around.
> Class "vtkOpenGLActor" has 1 instance still around.
> Class "vtkTransform" has 1 instance still around.
>
>
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/VTK-not-releasing-memory-including-minimal-example-tp5716258p5716262.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120923/48ce72b4/attachment.htm>
More information about the vtkusers
mailing list