Occurring vtkDebugLeaks even smartpointers are used

classic Classic list List threaded Threaded
3 messages Options
ran
Reply | Threaded
Open this post in threaded view
|

Occurring vtkDebugLeaks even smartpointers are used

ran
I'm using vtk 8.1.0 for displaying DICOM images in three windows in Qt widget
application in windows 10.
For this mainly uses uses three instances vtkResliceImageViewer,
vtkGenericOpenGLRenderWindow, vtkDICOMReader, vtkDICOMMetaData,
vtkInteractorStyleImage
also uses QVTKOpenGLWidget for fitting the images in Qt window.
I'm using smart pointers for all the objects, for vtk uses vtkSmartPointer,
Qt uses QPointer.
While the application window closes occurring a long list of vtkDebugLeaks.
Also, the application crashes while opening the second time.
Is these vtkDebugLeaks affect the application working? or can ignore
The list shows a long list which also includes classes not using and can't
find main classes of causing the leaks.
Even though uses smart pointers, why these leaks happen.

Below shows the list of leaks,

/vtkDebugLeaks has detected LEAKS!
Class "vtkOpenGLRenderTimerLog" has 3 instances still around.
Class "vtkOpenGLTextActor" has 6 instances still around.
Class "vtkSynchronizedTemplatesCutter3D" has 3 instances still around.
Class "vtk3DWidgetConnection" has 3 instances still around.
Class "vtkOpenGLTextMapper" has 3 instances still around.
Class "vtkTextureObject" has 6 instances still around.
Class "vtkCellData" has 78 instances still around.
Class "vtkResliceImageViewerMeasurements" has 3 instances still around.
Class "vtkTransformPolyDataFilter" has 3 instances still around.
Class "vtkCollection" has 9 instances still around.
Class "vtkFrustumCoverageCuller" has 3 instances still around.
Class "vtkInformationIntegerVectorValue" has 45 instances still around.
Class "vtkInformationVector" has 861 instances still around.
Class "vtkPerspectiveTransform" has 6 instances still around.
Class "vtkResliceCursorPicker" has 3 instances still around.
Class "vtkPlaneCollection" has 3 instances still around.
Class "vtkResliceCursorActor" has 3 instances still around.
Class "vtkPointData" has 78 instances still around.
Class "vtkImageActor" has 6 instances still around.
Class "vtkWidgetEventTranslator" has 6 instances still around.
Class "class vtkBuffer<unsigned short>" has 3 instances still around.
Class "vtkProperty2D" has 6 instances still around.
Class "vtkCompositeDataPipeline" has 153 instances still around.
Class "vtkMatrix3x3" has 144 instances still around.
Class "vtkProp3DCollection" has 9 instances still around.
Class "vtkTrivialProducer" has 45 instances still around.
Class "vtkOpenGLIndexBufferObject" has 552 instances still around.
Class "vtkMatrix4x4" has 669 instances still around.
Class "vtkUnsignedShortArray" has 3 instances still around.
Class "class vtkBuffer<__int64>" has 54 instances still around.
Class "vtkPickingManager" has 3 instances still around.
Class "QVTKInteractor" has 3 instances still around.
Class "vtkCoordinate" has 30 instances still around.
Class "vtkImageMapToColors" has 3 instances still around.
Class "vtkBox" has 3 instances still around.
Class "vtkPlane" has 18 instances still around.
Class "vtkSimpleTransform" has 27 instances still around.
Class "class vtkBuffer<unsigned char>" has 15 instances still around.
Class "vtkPlaneSource" has 6 instances still around.
Class "vtkPoints" has 105 instances still around.
Class "vtkIntArray" has 6 instances still around.
Class "vtkInformation" has 1902 instances still around.
Class "vtkImageReslice" has 3 instances still around.
Class "vtkActorCollection" has 12 instances still around.
Class "vtkLine" has 12 instances still around.
Class "vtkInformationStringVectorValue" has 6 instances still around.
Class "vtkBoundedPlanePointPlacer" has 3 instances still around.
Class "vtkGenericOpenGLRenderWindow" has 3 instances still around.
Class "vtkMultiThreader" has 15 instances still around.
Class "vtkVolumeCollection" has 3 instances still around.
Class "vtkAssemblyPath" has 3 instances still around.
Class "vtkPropCollection" has 27 instances still around.
Class "vtkResliceCursorLineRepresentation" has 3 instances still around.
Class "vtkAssemblyNode" has 3 instances still around.
Class "vtkInformationIntegerPointerValue" has 24 instances still around.
Class "vtkSynchronizedTemplates3D" has 3 instances still around.
Class "vtkGenericCell" has 9 instances still around.
Class "vtkDICOMMetaData" has 3 instances still around.
Class "vtkPolyData" has 57 instances still around.
Class "vtkLookupTable" has 6 instances still around.
Class "vtkPixel" has 12 instances still around.
Class "class vtkBuffer<int>" has 6 instances still around.
Class "vtkPropPicker" has 6 instances still around.
Class "imriLocalizerVtkInteractionStyleImage" has 3 instances still around.
Class "vtkActor2D" has 6 instances still around.
Class "vtkOpenGLCamera" has 3 instances still around.
Class "vtkPlaneWidget" has 3 instances still around.
Class "vtkOpenGLVertexArrayObject" has 552 instances still around.
Class "vtkOpenGLActor" has 69 instances still around.
Class "vtkResliceCursorWidget" has 3 instances still around.
Class "vtkOpenGLPolyDataMapper" has 72 instances still around.
Class "vtkIdList" has 48 instances still around.
Class "vtkWorldPointPicker" has 6 instances still around.
Class "vtkEmptyCell" has 9 instances still around.
Class "vtkRectilinearSynchronizedTemplates" has 3 instances still around.
Class "vtkObserverMediator" has 3 instances still around.
Class "vtkConeSource" has 6 instances still around.
Class "vtkDoubleArray" has 66 instances still around.
Class "vtkInteractorStyleImage" has 3 instances still around.
Class "vtkMatrixToLinearTransform" has 9 instances still around.
Class "vtkAlgorithmOutput" has 93 instances still around.
Class "vtkCullerCollection" has 3 instances still around.
Class "vtkOpenGLRenderer" has 3 instances still around.
Class "vtkImageStencilData" has 3 instances still around.
Class "vtkInformationIntegerValue" has 1743 instances still around.
Class "vtkImageProperty" has 6 instances still around.
Class "vtkTextProperty" has 15 instances still around.
Class "vtkOpenGLPolyDataMapper2D" has 12 instances still around.
Class "vtkGridSynchronizedTemplates3D" has 3 instances still around.
Class "vtkOpenGLLight" has 3 instances still around.
Class "vtkTextRepresentation" has 3 instances still around.
Class "vtkCellArray" has 54 instances still around.
Class "vtkRendererCollection" has 3 instances still around.
Class "vtkClipPolyData" has 3 instances still around.
Class "vtkShaderProgram" has 9 instances still around.
Class "class vtkBuffer<float>" has 81 instances still around.
Class "vtkResliceCursor" has 3 instances still around.
Class "vtkCutter" has 3 instances still around.
Class "vtkOpenGLShaderCache" has 3 instances still around.
Class "vtkTDxInteractorStyleCamera" has 6 instances still around.
Class "vtkImageData" has 21 instances still around.
Class "vtkFloatArray" has 81 instances still around.
Class "vtkInformationStringValue" has 24 instances still around.
Class "vtkInformationExecutivePortVectorValue" has 93 instances still
around.
Class "vtkImageMapToWindowLevelColors" has 3 instances still around.
Class "vtkContourValues" has 15 instances still around.
Class "vtkIdTypeArray" has 54 instances still around.
Class "vtkTransform" has 276 instances still around.
Class "vtkLinearExtrusionFilter" has 6 instances still around.
Class "vtkOutlineSource" has 6 instances still around.
Class "vtkOpenGLVertexBufferObjectGroup" has 84 instances still around.
Class "vtkFieldData" has 84 instances still around.
Class "vtkTextWidget" has 3 instances still around.
Class "vtkOpenGLProperty" has 33 instances still around.
Class "class vtkBuffer<double>" has 66 instances still around.
Class "vtkScalarsToColors" has 6 instances still around.
Class "vtkOpenGLTexture" has 18 instances still around.
Class "vtkInformationDoubleVectorValue" has 45 instances still around.
Class "vtkLineSource" has 6 instances still around.
Class "vtkLightCollection" has 3 instances still around.
Class "vtkEvent" has 42 instances still around.
Class "vtkWidgetCallbackMapper" has 6 instances still around.
Class "vtkUnsignedCharArray" has 15 instances still around.
Class "vtkSphereSource" has 12 instances still around.
Class "vtkShader" has 27 instances still around.
Class "vtkTDxInteractorStyleSettings" has 6 instances still around.
Class "vtkCellPicker" has 6 instances still around.
Class "vtkStreamingDemandDrivenPipeline" has 45 instances still around.
Class "vtkResliceCursorPolyDataAlgorithm" has 3 instances still around.
Class "vtkTextureUnitManager" has 3 instances still around.
Class "vtkOpenGLVertexBufferObjectCache" has 3 instances still around.
Class "vtkActor2DCollection" has 3 instances still around.
Class "vtkAssemblyPaths" has 3 instances still around.
Class "vtkTimerLog" has 93 instances still around.
Class "vtkResliceImageViewer" has 3 instances still around.
Class "vtkCommand or subclass" has 135 instances still around.
Class "vtkOpenGLImageSliceMapper" has 6 instances still around.
Class "vtkInformationExecutivePortValue" has 126 instances still around.
Class "vtkFXAAOptions" has 3 instances still around.
/



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Occurring vtkDebugLeaks even smartpointers are used

David Gobbi
Hi Ran,

It's good to see people using vtkDICOMReader instead of the old vtkDICOMImageReader!

My guess is that vtkGenericOpenGLRenderWindow isn't being deleted, and it is holding references (directly or indirectly) to all of the other objects that are leaking.  And, of course, the QVTKOpenGLWidget holds the reference to the vtkGenericOpenGLRenderWindow.

So either QVTKOpenGLWidget isn't being destroyed, or you are keeping an extra reference to vtkGenericOpenGLRenderWindow in addition to the reference kept by QVTKOpenGLWidget.  Once you fix the vtkGenericOpenGLRenderWindow leak, then all the other leaks should vanish.

  David

On Tue, Dec 4, 2018 at 7:28 AM ran <[hidden email]> wrote:
I'm using vtk 8.1.0 for displaying DICOM images in three windows in Qt widget
application in windows 10.
For this mainly uses uses three instances vtkResliceImageViewer,
vtkGenericOpenGLRenderWindow, vtkDICOMReader, vtkDICOMMetaData,
vtkInteractorStyleImage
also uses QVTKOpenGLWidget for fitting the images in Qt window.
I'm using smart pointers for all the objects, for vtk uses vtkSmartPointer,
Qt uses QPointer.
While the application window closes occurring a long list of vtkDebugLeaks.
Also, the application crashes while opening the second time.
Is these vtkDebugLeaks affect the application working? or can ignore
The list shows a long list which also includes classes not using and can't
find main classes of causing the leaks.
Even though uses smart pointers, why these leaks happen.

Below shows the list of leaks,

/vtkDebugLeaks has detected LEAKS!
Class "vtkOpenGLRenderTimerLog" has 3 instances still around.
Class "vtkOpenGLTextActor" has 6 instances still around.
Class "vtkSynchronizedTemplatesCutter3D" has 3 instances still around.
Class "vtk3DWidgetConnection" has 3 instances still around.
Class "vtkOpenGLTextMapper" has 3 instances still around.
Class "vtkTextureObject" has 6 instances still around.
Class "vtkCellData" has 78 instances still around.
Class "vtkResliceImageViewerMeasurements" has 3 instances still around.
Class "vtkTransformPolyDataFilter" has 3 instances still around.
Class "vtkCollection" has 9 instances still around.
Class "vtkFrustumCoverageCuller" has 3 instances still around.
Class "vtkInformationIntegerVectorValue" has 45 instances still around.
Class "vtkInformationVector" has 861 instances still around.
Class "vtkPerspectiveTransform" has 6 instances still around.
Class "vtkResliceCursorPicker" has 3 instances still around.
Class "vtkPlaneCollection" has 3 instances still around.
Class "vtkResliceCursorActor" has 3 instances still around.
Class "vtkPointData" has 78 instances still around.
Class "vtkImageActor" has 6 instances still around.
Class "vtkWidgetEventTranslator" has 6 instances still around.
Class "class vtkBuffer<unsigned short>" has 3 instances still around.
Class "vtkProperty2D" has 6 instances still around.
Class "vtkCompositeDataPipeline" has 153 instances still around.
Class "vtkMatrix3x3" has 144 instances still around.
Class "vtkProp3DCollection" has 9 instances still around.
Class "vtkTrivialProducer" has 45 instances still around.
Class "vtkOpenGLIndexBufferObject" has 552 instances still around.
Class "vtkMatrix4x4" has 669 instances still around.
Class "vtkUnsignedShortArray" has 3 instances still around.
Class "class vtkBuffer<__int64>" has 54 instances still around.
Class "vtkPickingManager" has 3 instances still around.
Class "QVTKInteractor" has 3 instances still around.
Class "vtkCoordinate" has 30 instances still around.
Class "vtkImageMapToColors" has 3 instances still around.
Class "vtkBox" has 3 instances still around.
Class "vtkPlane" has 18 instances still around.
Class "vtkSimpleTransform" has 27 instances still around.
Class "class vtkBuffer<unsigned char>" has 15 instances still around.
Class "vtkPlaneSource" has 6 instances still around.
Class "vtkPoints" has 105 instances still around.
Class "vtkIntArray" has 6 instances still around.
Class "vtkInformation" has 1902 instances still around.
Class "vtkImageReslice" has 3 instances still around.
Class "vtkActorCollection" has 12 instances still around.
Class "vtkLine" has 12 instances still around.
Class "vtkInformationStringVectorValue" has 6 instances still around.
Class "vtkBoundedPlanePointPlacer" has 3 instances still around.
Class "vtkGenericOpenGLRenderWindow" has 3 instances still around.
Class "vtkMultiThreader" has 15 instances still around.
Class "vtkVolumeCollection" has 3 instances still around.
Class "vtkAssemblyPath" has 3 instances still around.
Class "vtkPropCollection" has 27 instances still around.
Class "vtkResliceCursorLineRepresentation" has 3 instances still around.
Class "vtkAssemblyNode" has 3 instances still around.
Class "vtkInformationIntegerPointerValue" has 24 instances still around.
Class "vtkSynchronizedTemplates3D" has 3 instances still around.
Class "vtkGenericCell" has 9 instances still around.
Class "vtkDICOMMetaData" has 3 instances still around.
Class "vtkPolyData" has 57 instances still around.
Class "vtkLookupTable" has 6 instances still around.
Class "vtkPixel" has 12 instances still around.
Class "class vtkBuffer<int>" has 6 instances still around.
Class "vtkPropPicker" has 6 instances still around.
Class "imriLocalizerVtkInteractionStyleImage" has 3 instances still around.
Class "vtkActor2D" has 6 instances still around.
Class "vtkOpenGLCamera" has 3 instances still around.
Class "vtkPlaneWidget" has 3 instances still around.
Class "vtkOpenGLVertexArrayObject" has 552 instances still around.
Class "vtkOpenGLActor" has 69 instances still around.
Class "vtkResliceCursorWidget" has 3 instances still around.
Class "vtkOpenGLPolyDataMapper" has 72 instances still around.
Class "vtkIdList" has 48 instances still around.
Class "vtkWorldPointPicker" has 6 instances still around.
Class "vtkEmptyCell" has 9 instances still around.
Class "vtkRectilinearSynchronizedTemplates" has 3 instances still around.
Class "vtkObserverMediator" has 3 instances still around.
Class "vtkConeSource" has 6 instances still around.
Class "vtkDoubleArray" has 66 instances still around.
Class "vtkInteractorStyleImage" has 3 instances still around.
Class "vtkMatrixToLinearTransform" has 9 instances still around.
Class "vtkAlgorithmOutput" has 93 instances still around.
Class "vtkCullerCollection" has 3 instances still around.
Class "vtkOpenGLRenderer" has 3 instances still around.
Class "vtkImageStencilData" has 3 instances still around.
Class "vtkInformationIntegerValue" has 1743 instances still around.
Class "vtkImageProperty" has 6 instances still around.
Class "vtkTextProperty" has 15 instances still around.
Class "vtkOpenGLPolyDataMapper2D" has 12 instances still around.
Class "vtkGridSynchronizedTemplates3D" has 3 instances still around.
Class "vtkOpenGLLight" has 3 instances still around.
Class "vtkTextRepresentation" has 3 instances still around.
Class "vtkCellArray" has 54 instances still around.
Class "vtkRendererCollection" has 3 instances still around.
Class "vtkClipPolyData" has 3 instances still around.
Class "vtkShaderProgram" has 9 instances still around.
Class "class vtkBuffer<float>" has 81 instances still around.
Class "vtkResliceCursor" has 3 instances still around.
Class "vtkCutter" has 3 instances still around.
Class "vtkOpenGLShaderCache" has 3 instances still around.
Class "vtkTDxInteractorStyleCamera" has 6 instances still around.
Class "vtkImageData" has 21 instances still around.
Class "vtkFloatArray" has 81 instances still around.
Class "vtkInformationStringValue" has 24 instances still around.
Class "vtkInformationExecutivePortVectorValue" has 93 instances still
around.
Class "vtkImageMapToWindowLevelColors" has 3 instances still around.
Class "vtkContourValues" has 15 instances still around.
Class "vtkIdTypeArray" has 54 instances still around.
Class "vtkTransform" has 276 instances still around.
Class "vtkLinearExtrusionFilter" has 6 instances still around.
Class "vtkOutlineSource" has 6 instances still around.
Class "vtkOpenGLVertexBufferObjectGroup" has 84 instances still around.
Class "vtkFieldData" has 84 instances still around.
Class "vtkTextWidget" has 3 instances still around.
Class "vtkOpenGLProperty" has 33 instances still around.
Class "class vtkBuffer<double>" has 66 instances still around.
Class "vtkScalarsToColors" has 6 instances still around.
Class "vtkOpenGLTexture" has 18 instances still around.
Class "vtkInformationDoubleVectorValue" has 45 instances still around.
Class "vtkLineSource" has 6 instances still around.
Class "vtkLightCollection" has 3 instances still around.
Class "vtkEvent" has 42 instances still around.
Class "vtkWidgetCallbackMapper" has 6 instances still around.
Class "vtkUnsignedCharArray" has 15 instances still around.
Class "vtkSphereSource" has 12 instances still around.
Class "vtkShader" has 27 instances still around.
Class "vtkTDxInteractorStyleSettings" has 6 instances still around.
Class "vtkCellPicker" has 6 instances still around.
Class "vtkStreamingDemandDrivenPipeline" has 45 instances still around.
Class "vtkResliceCursorPolyDataAlgorithm" has 3 instances still around.
Class "vtkTextureUnitManager" has 3 instances still around.
Class "vtkOpenGLVertexBufferObjectCache" has 3 instances still around.
Class "vtkActor2DCollection" has 3 instances still around.
Class "vtkAssemblyPaths" has 3 instances still around.
Class "vtkTimerLog" has 93 instances still around.
Class "vtkResliceImageViewer" has 3 instances still around.
Class "vtkCommand or subclass" has 135 instances still around.
Class "vtkOpenGLImageSliceMapper" has 6 instances still around.
Class "vtkInformationExecutivePortValue" has 126 instances still around.
Class "vtkFXAAOptions" has 3 instances still around.
/



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
ran
Reply | Threaded
Open this post in threaded view
|

Re: Occurring vtkDebugLeaks even smartpointers are used

ran
Thank you very much for the support,
My QVTKOpenGLWidget, vtkGenericOpenGLRenderWindow related code is like this
as per vtk tutorial

The app has a main Qt widget file

*/widget.h declaration file/*

     QPointer<QHBoxLayout> m_loMain;  

    vtkNew <vtkGenericOpenGLRenderWindow> m_vtkRenderWindow1;
    QPointer <QVTKOpenGLWidget> m_vtkWgtWin1;

    vtkNew <vtkGenericOpenGLRenderWindow> m_vtkRenderWindow2;
    QPointer <QVTKOpenGLWidget> m_vtkWgtWin2;

    vtkNew <vtkGenericOpenGLRenderWindow> m_vtkRenderWindow3;
    QPointer <QVTKOpenGLWidget> m_vtkWgtWin3;

*/and defined in widget.cpp constructor/*

   QPointer<QHBoxLayout> m_loMain;  

   m_vtkWgtWin1 = new QVTKOpenGLWidget(this);
   m_vtkWgtWin1->SetRenderWindow(m_vtkRenderWindow1);
   m_loMain->addWidget(m_vtkWgtWin1);

   m_vtkWgtWin2 = new QVTKOpenGLWidget(this);
   m_vtkWgtWin2->SetRenderWindow(m_vtkRenderWindow2);
   m_loMain->addWidget(m_vtkWgtWin2);

   m_vtkWgtWin3 = new QVTKOpenGLWidget(this);
   m_vtkWgtWin3>SetRenderWindow(m_vtkRenderWindow3);
   m_loMain->addWidget(m_vtkWgtWin3);

*/and in app main class/*

    // before initializing QApplication, set the default surface format.
    QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat();
    fmt.setSamples(0);
    QSurfaceFormat::setDefaultFormat(fmt);

have any issue in this code?

*/Also i tried with the format /*
QVTKOpenGLWidget::SetRenderWindow(vtkGenericOpenGLRenderWindow::Get());
but this also not solving the issue



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers