VTK debug_leaks with Visual studio 2013

Hi,

I have observed some strange behavior with “VTK debug leaks” in VS 2013.
In a sample project made with VTK 8.1, I’m able to get the debug leaks in console when I close the application. But in Main project, unable to get the debug leaks on application close.

for clear reasons, couldn’t post the details of classes or code snippets used in main project.

Please let me know if there exist any settings in Visual studio or vtk classes which can block debug info.

Thanks in Advance,
Sateesh

Memory leak reporting works well in VTK master with recent VS versions, so most likely the problem is that your code uses VTK in an unusual way (or there is a small chance that the different behavior is due to your extremely old compiler version). Can you provide a minimum reproducible example with VS2017 or later?

I’ve just realized that there is a duplicate topic for this - see some more discussions there: VTK debug leaks with Visual studio 2013. My recommendation still holds - create a minimal reproducible example, without that people can just guess what is wrong in your code.

Hi @lassoan,

Thank you for the suggestions. According l have moved to Visual studio 2017 with VTK 8.2.0.
Working on “minimum reproducible example”

I have one query regarding “subsystem settings for vtkdebugleaks” in VTK - Visual studio project.

  1. In the subsystem settings → VS2017 : if we select “Console (/SUBSYSTEM:CONSOLE)”, I’m able to see Debug leaks on the console when application is closed.

2.If I choose “Windows (/SUBSYSTEM:WINDOWS)”, I couldn’t see any output in output window of Visual studio. Trying to redirect the output of vtk to a file using “VtkOutputWindow”.

My question is that Using Visual studio in windows, can we see vtkdebugleaks using SUBSYSTEM:WINDOWS in linker-> system settings?

Everything works as expected then. Here is a complete example of how to set logging to file on Windows: https://kitware.github.io/vtk-examples/site/Cxx/Utilities/FileOutputWindow/

Hi @lassoan

I apologize for this late reply. Everything seems to be working fine with the sample program.

No success in producing the scenario I have observed in “Main project”.

can you please suggest if there are any other Third party software’s which can give us vtkdebugleaks…

Thanks in Advance.

Can you clarify what you mean by “give us vtkdebugleaks”?

Hi @lassoan,

I mean to get the memory leaks in classes related to vtk.
specifically in Windows environment.