[vtkusers] Verbosity of VTK_DEBUG_LEAKS?
Bill Lorensen
bill.lorensen at gmail.com
Mon Oct 12 18:03:12 EDT 2009
Another problem with vtkDebugLeaks is that it only finds leaks of vtk
objects. It will not find malloc/new memory leaks of native types.
valgrind does a much better job of finding leaks.
Also, as you noted, it is best to use the vtkSmartPointer as often as you can.
On Mon, Oct 12, 2009 at 4:11 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> Simply changing one line from
> vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::New();
> to
> vtkPolyData* poly = vtkPolyData::New();
> (and of course forgetting to delete it) generates the following messages:
>
> vtkDebugLeaks has detected LEAKS!
> Class "vtkCellData" has 1 instance still around.
> Class "vtkInformationVector" has 3 instances still around.
> Class "vtkPointData" has 1 instance still around.
> Class "vtkTrivialProducer" has 1 instance still around.
> Class "vtkPoints" has 1 instance still around.
> Class "vtkInformation" has 6 instances still around.
> Class "vtkPolyData" has 1 instance still around.
> Class "vtkAlgorithmOutput" has 1 instance still around.
> Class "vtkInformationIntegerValue" has 10 instances still around.
> Class "vtkCellArray" has 2 instances still around.
> Class "vtkFloatArray" has 1 instance still around.
> Class "vtkInformationStringValue" has 1 instance still around.
> Class "vtkInformationExecutivePortVectorValue" has 1 instance still around.
> Class "vtkIdTypeArray" has 2 instances still around.
> Class "vtkFieldData" has 1 instance still around.
> Class "vtkInformationDoubleVectorValue" has 2 instances still around.
> Class "vtkUnsignedCharArray" has 1 instance still around.
> Class "vtkStreamingDemandDrivenPipeline" has 1 instance still around.
> Class "vtkInformationExecutivePortValue" has 1 instance still around.
>
> It's pretty tough to figure out what was actually the root of the problem by
> looking at that list. Is there a way to say "show only parents" or something
> like that, so that only the things highest up in the hierarchy are shown?
> That is, deleting that polydata object in turn deletes the rest of those
> "under the hood" things automatically, so I don't really need to be notified
> about those.
>
> Is anything like this possible?
>
> Thanks,
>
> David
>
> _______________________________________________
> 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
>
>
More information about the vtkusers
mailing list