MantisBT - ITK
View Issue Details
0001033ITKpublic2004-08-06 23:182010-10-25 15:39
Luis Ibanez 
kentwilliams 
urgentmajoralways
closedfixed 
ITK-4-A3 
 
2011-10-25
backlog
0001033: Memory Leaks in the SimplexMesh class
Purify reports memory leaks in the SimplexMesh class.
They seem to be related to the GeometryMap container.
No tags attached.
Issue History
2007-09-18 11:19Luis IbanezNote Added: 0009073
2007-09-18 11:19Luis IbanezNote Added: 0009074
2007-09-18 11:19Luis IbanezPrioritylow => urgent
2008-05-20 11:03Wilbur C. K. WongAssigned ToLuis Ibanez => Wilbur C. K. Wong
2010-10-21 13:53Hans JohnsonAssigned ToWilbur C. K. Wong => kentwilliams
2010-10-21 17:16kentwilliamsNote Added: 0022655
2010-10-21 17:40kentwilliamsNote Added: 0022656
2010-10-25 15:11kentwilliamsNote Added: 0022679
2010-10-25 15:39kentwilliamsResolution Date => 2011-10-25
2010-10-25 15:39kentwilliamsSprint Status => backlog
2010-10-25 15:39kentwilliamsNote Added: 0022681
2010-10-25 15:39kentwilliamsStatusassigned => closed
2010-10-25 15:39kentwilliamsResolutionopen => fixed
2010-10-25 15:39kentwilliamsProduct Version => ITK-4-A3

Notes
(0001356)
Luis Ibanez   
2004-08-06 23:20   
The destructor has now been declared virtual
(it wasn't despite the fact of having other virtual functions).

No the GeometryMap is visited and all its elements are erased with "delete".
(0001360)
Luis Ibanez   
2004-08-07 19:33   
After fixing the GeometryMap container,
We found that there are additional memory leaks.

In order to see the full extent of the memory leak
the following command may be used with Valgrind

valgrind -v --leak-check=yes --leak-resolution=high ./SimplexMeshTest
(0001929)
Lydia Ng   
2005-01-14 13:40   
triaged 1/14/2005
(0009073)
Luis Ibanez   
2007-09-18 11:19   
Urgent to be addressed during WA10.
Setup Valgrind builds and review memory leaks reports.
(0009074)
Luis Ibanez   
2007-09-18 11:19   
It is urgent to address the review of memory leaks.
(0022655)
kentwilliams   
2010-10-21 17:16   
I built on a machine with Valgrind and ran all the SimplexMesh tests under valgrind. Only itksimplexMeshToTriangleMeshFilterTest reported leaks. I'm investigating fixing this.
(0022656)
kentwilliams   
2010-10-21 17:40   
I am suspecting that the memory leaks reported in itkSimplexMeshToTriangleMeshFilterTest are false positives. They all have to do with the use of the member variable m_NewSimplexCellPointer, which is a member of itk::SimplexMeshAdaptTopologyFilter and itk::TriangleMeshToSimplexMeshFilter. In both cases, objects are allocated with new and assigned to this variable via its TakeOwnership method.

So either the AutoPointer class doesn't work or valgrind is confused.
(0022679)
kentwilliams   
2010-10-25 15:11   
The problem with the itkSimplexMeshToTriangleMeshFilterTest doesn't make any sense; if I add this:

originalTriangleMesh = 0;
simplexFilter = 0;

To the bottom of that test, the memory errors go away.
(0022681)
kentwilliams   
2010-10-25 15:39   
The particular bug reported is no longer reproducable. I logged a new bug http://public.kitware.com/Bug/view.php?id=11360 [^]

for the problem I found in a different, related test.