[vtkusers] Memory leak only happens in release, not in debug

Hong Yi hongyi at renci.org
Mon Nov 14 14:34:29 EST 2011



From: Hong Yi
Sent: Monday, November 14, 2011 2:31 PM
To: 'Gonza Barrio'
Subject: RE: [vtkusers] Memory leak only happens in release, not in debug

Thanks, Gonza. I have solved this crash problem which turns out to be an incompatibility problem between MS Visual Studio 2010 and 2008. I build VTK library in MS VS 2008, but had been building my app in VS 2010. I guess there are some incompatibility or run time memory management problem when calling VTK functions from VS 2010 release mode. Anyway, when I moved my app to VS 2008 and build the app there, no crash even happened again and everything runs predictably. Report this to the list in case this provides some useful info to others in the future.

Hong

From: Gonza Barrio [mailto:gnzbar at gmail.com]<mailto:[mailto:gnzbar at gmail.com]>
Sent: Friday, October 28, 2011 3:48 AM
To: Hong Yi
Subject: Re: [vtkusers] Memory leak only happens in release, not in debug

If it doesnt happens when running in debug could be an Instruction-level Parallelism problem created by the compiler.

Try to reproduce the memory leak with another compiler.
2011/10/26 Hong Yi <hongyi at renci.org<mailto:hongyi at renci.org>>
I run into a very annoying memory leak problem that only happens when running in release and works perfectly when running in debug. The problem happens when I load a different set of multiple data files for analysis without exiting the tool. What I did is to delete every vtk object such as PolyData, actors, mappers, etc., previously allocated for the previously loaded datasets before loading new datasets and allocate memory again for the new datasets. Since the memory leak problem does not happen when running in debug but only happens when running in release (specifically, the memory grows gradually until it runs out of system memory when running in release), I cannot really debug this memory leak problem in the usual way. The thing that puzzles me is that memory usage is normal and there is no memory leak at all when running in debug, but happens only in release most of the times. Sometimes memory leak does not happen even in release which seems to occur only when I test it in release within Visual Studio IDE right after I test it in debug. I am hoping to get some suggestions and tips on how to go about tracking down this memory leak problem.

Thank you very much for any suggestions and tips on tracking down this memory leak problem.

Hong



_______________________________________________
Powered by www.kitware.com<http://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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111114/e47490c6/attachment.htm>


More information about the vtkusers mailing list