Download - ITK/GDCM Memory Leak
![Page 2: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/2.jpg)
Overview ITK/DICOM/GDCM overview Goals Tools Process Bug Details Results What I Learned
![Page 3: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/3.jpg)
ITK
Image Segmentation and Registration toolkit BSD Licensed We've heard a lot about this one already...
![Page 4: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/4.jpg)
DICOM
Digital Imaging and Communications in Medicine
Standard for storage/transmission/etc. Of medical images
Both a file format and network protocol Extremely widespread usage
![Page 5: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/5.jpg)
GDCM
Grassroots DICOM Originally named Gnu DiCoM
Open source cross platform library for DICOM files
BSD Licensed C++ Bundled inside of ITK
![Page 6: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/6.jpg)
Goals
Fix memory leak in GDCM Specifically the version utilized by ITK
Occurred during loading of DICOM files
![Page 7: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/7.jpg)
Valgrind
Tool for memory leak detection, profiling, etc. Generic framework for dynamic analysis tools
This project utilized memory leak detection (Memcheck)
Can be used on any executable Greatly degrades performance Quick Demo
![Page 8: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/8.jpg)
Process
Obtain/build ITK Source Find GDCM source Use Valgrind to find memory leak Investigate code to find source of leak Fix leak and contribute back
![Page 9: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/9.jpg)
Bug Details Valgrind Output
![Page 10: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/10.jpg)
Bug Details Valgrind Output
![Page 11: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/11.jpg)
Bug Details DocEntrySet::NewSeqEntry
![Page 12: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/12.jpg)
Bug Details Document::ParseDES
![Page 13: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/13.jpg)
Bug Details Document::ParseDES
![Page 14: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/14.jpg)
Bug Details ElementSet::RemoveEntry
![Page 15: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/15.jpg)
Results
Sucessfully fixed the issue Problem already solved
Discovered after a CVS update Traced back to a bug online
http://www.itk.org/Bug/view.php?id=7004 Bug submitted 5/13, with proposed fix
![Page 16: ITK/GDCM Memory Leak](https://reader031.vdocuments.site/reader031/viewer/2022020201/56814d83550346895dbae218/html5/thumbnails/16.jpg)
What I Learned
Valgrind is really cool How to use Cmake Got acquainted with large open source project Communicate with project developers before
contributing Mailing lists, etc.