[vtk-developers] Offscreen rendering OpenGL, linux, leaks memory

Dan Lipsa dan.lipsa at kitware.com
Thu Jun 9 14:45:48 EDT 2016


I did run it, it does not report anything. This is the report for 10
iterations. It was similar for 10000.
Maybe the memory is allocated by the driver and not caught by valgrind.

=24195== HEAP SUMMARY:
==24195==     in use at exit: 113 bytes in 3 blocks
==24195==   total heap usage: 28,105 allocs, 28,102 frees, 18,108,607 bytes
allocated
==24195==
==24195== LEAK SUMMARY:
==24195==    definitely lost: 0 bytes in 0 blocks
==24195==    indirectly lost: 0 bytes in 0 blocks
==24195==      possibly lost: 0 bytes in 0 blocks
==24195==    still reachable: 113 bytes in 3 blocks
==24195==         suppressed: 0 bytes in 0 blocks
==24195== Reachable blocks (those to which a pointer was found) are not
shown.
==24195== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==24195==
==24195== For counts of detected and suppressed errors, rerun with: -v
==24195== Use --track-origins=yes to see where uninitialised values come
from
==24195== ERROR SUMMARY: 292 errors from 5 contexts (suppressed: 0 from 0)


On Thu, Jun 9, 2016 at 2:24 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:

> If you are on linux, can you run valgrind on this?
>
> Bill
>
> On Thu, Jun 9, 2016 at 1:37 PM, Dan Lipsa <dan.lipsa at kitware.com> wrote:
> > Hi all,
> > Does anybody have seen or has advice on fixing the following bug.
> > Thank you.
> >
> > http://www.vtk.org/Bug/view.php?id=16744
> >
> > I paste here a portion of the test I am using. The whole test is in
> mantis.
> >
> > 10000 iterations of Render leak about 20MB according the reports from the
> > OS. The render window is kept around and the renderer and all other
> objects
> > are deleted and and re-added at each iteration.
> >
> > The same program does not leak for onscreen OpenGL or offscreen/onscreen
> > OpenGL2.
> >
> >
> >
> > void iteration(int i, vtkRenderWindow* renderWindow)
> > {
> >   vtkSmartPointer<vtkCylinderSource> cylinder =
> >     vtkSmartPointer<vtkCylinderSource>::New();
> >   cylinder->SetResolution(8);
> >
> >   vtkSmartPointer<vtkPolyDataMapper> cylinderMapper =
> >     vtkSmartPointer<vtkPolyDataMapper>::New();
> >   cylinderMapper->SetInputConnection(cylinder->GetOutputPort());
> >
> >   vtkSmartPointer<vtkActor> cylinderActor =
> >     vtkSmartPointer<vtkActor>::New();
> >   cylinderActor->SetMapper(cylinderMapper);
> >   cylinderActor->GetProperty()->SetColor(1.0000, 0.3882, 0.2784);
> >   cylinderActor->RotateX(30.0);
> >   cylinderActor->RotateY(-45.0);
> >
> >   vtkSmartPointer<vtkRenderer> renderer =
> >     vtkSmartPointer<vtkRenderer>::New();
> >   renderer->AddActor(cylinderActor);
> >   renderer->SetBackground(0.1, 0.2, 0.4);
> >   // Zoom in a little by accessing the camera and invoking its "Zoom"
> > method.
> >   renderer->ResetCamera();
> >
> >   renderWindow->AddRenderer(renderer);
> >   renderWindow->Render();
> >   renderWindow->RemoveRenderer(renderer);
> > }
> >
> > int main()
> > {
> >   vtkSmartPointer<vtkRenderWindow> renderWindow =
> >     vtkSmartPointer<vtkRenderWindow>::New();
> >   renderWindow->SetSize(200, 200);
> >   //renderWindow->OffScreenRenderingOn();
> >   for (int i = 0; i < 10000; ++i)
> >     {
> >     iteration(i, renderWindow);
> >     if (i % 10 == 0)
> >       {
> >       std::cout << i << " ==== Iteration ====" << std::endl;
> >       os_memory_usage();
> >       }
> >     }
> >   return 0;
> > }
> >
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Search the list archives at:
> http://markmail.org/search/?q=vtk-developers
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtk-developers
> >
> >
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160609/915bdae9/attachment.html>


More information about the vtk-developers mailing list