Page 1 of 1

Plugin Development - Memory Leak

Posted: Tue Oct 24, 2017 8:28 pm
by JohnDoe
Any tips or tricks to keep from acquiring memory leaks? I have recently been messing with the code to work on some perosnal plugins, however am starting to notice that I have memory leaks. If i process a cloud through my plugin, and then delete the cloud from the dbtree using the UI, I see residual memory being used in my task manager (That is more memory is being used than when cloudcompare was launched, however theres no clouds being stored - at least not to the users vision)

If you have any advice for tracing, tracking, and fixing memory leaks, it would be greatly appreciated.

Re: Plugin Development - Memory Leak

Posted: Tue Oct 24, 2017 8:47 pm
by daniel
It depends on what OS and IDE you are working with.

Personally I used Visual Studio and Visual Leak Detector (which can be 'enabled' in the CMake configuration of CC - you first have to install VLD of course).

Otherwise I know Valgrind on linux is very powerful.

Re: Plugin Development - Memory Leak

Posted: Wed Oct 25, 2017 3:26 pm
by JohnDoe
I am working on windows in visual studio as well. I will see if I can find this enabling feature later this afternoon. Thanks!