Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   run-time errors and memory leaks detection (http://www.go4expert.com/forums/run-time-errors-memory-leaks-detection-t23824/)

August 10Nov2010 21:55

run-time errors and memory leaks detection
 
Hi!

Created application is working toooo slow, looks like there are a lot of memory leaks, there are a lot of pointers. So, please, can you advice some effective tool for run-time errors and memory leaks detection in Visual Studio C++?

xpi0t0s 11Nov2010 13:55

Re: run-time errors and memory leaks detection
 
There's no substitute for a skilled programmer going carefully through the code and fixing the problems. You can use stuff like valgrind but the problem with these tools is that people put too much faith in them, for some reason they think valgrind can solve all their coding problems and make them a cup of tea while they're waiting. Maybe that's the ideal that the valgrind programmers are working towards but automated tools at present can't find stuff that a skilled programmer can't find quickly anyway, and you still need that skilled programmer to look for the more tricky bugs.

The best solution to memory leaks is not to create them in the first place: whenever you write "new", write "delete" somewhere, even if just to cause a compiler error so that you can't continue until you have placed that delete. Same with malloc and co, write "free" somewhere and don't go onto the next task until you've sorted out that free. Try to allocate and free resources within the same function.

Memory leaks and pointers in themselves don't cause code to run slowly though. Probably the algorithms themselves need looking at. Have you tried code profiling?

August 19Nov2010 00:31

Re: run-time errors and memory leaks detection
 
Yeah. Looks like I've found a decision - Deleaker

StarDrago 19Jan2012 13:36

Re: run-time errors and memory leaks detection
 
Quote:

Originally Posted by August (Post 74866)
Yeah. Looks like I've found a decision - Deleaker

Good debugger! I use it for search GDI and memory leaks:cuss::crazy:


All times are GMT +5.5. The time now is 00:37.