Memory Leaks?


#1

Hi jules and everybody !

I am using Juce 1.26 (I have to update !) and Visual Studio.NET 2003. I have a problem in my code and I have some difficulties to find where : during the execution of my program, I use some very big vectors, with a lot of CPU power needs, and at the end of the processing I get frequently some bugs in the GUI, like characters or buttons diseappearing… I imagine it’s a problem about objects’ initialization, but Visual Studio.NET never reports memory leaks when I close the program…

How can I detect where are the problems in my code ? Thanks !


#2

Using tools such as Rationnal Purify (for Windows, commercial and quite expensive) or Valgring under GNU/Linux (free) might be a good starting point …


#3

http://www.codeproject.com/tools/visualleakdetector.asp


#4

Thanks for the answers !

Visual Leak Detector looks interesting… A question, it is possible that this software detects some memory leaks that Visual C++ can’t see itself alone ? That’s my main problem…


#5

Sounds to me more like you’re deleting dangling pointers or overwrting some memory. Memory leaks don’t tend to cause any obvious bugs.


#6

Hello Jules :wink:

I think so. I really have a problem with these memory allocations… I have tried to put one “delete” for each “new”, to instanciate properly each objects and put the right things in their constructors, but that still doesn’t work… I have imagined that when I do some mistakes in memory allocations (like forgetting to delete something or deleting it “too much”), there is some empty memory remaining and so some memory leaks, but I am maybe wrong.

Maybe it’s the way I instanciate some librairies too (I’m using for example FFTW). And I have seen some librairies which delete the objects automatically, we have to use the “new” instruction but the “delete” makes the software crash, like VST GUI.


#7

Well if c++ wasn’t so tricky, it wouldn’t be half as much fun, would it!


#8

:lol: :lol: :lol: :lol: :lol:

Anyway, sometimes I think I’d like to go the past to kill some people, like the one who has created the pointers. And sometimes I think I should kill people from this time first, like the one who has done the ASIO SDK documentation 8)


#9

without pointers, my life will sure be boring and non-sense… :twisted:


#10

Pointers is near the very reason C++ is so powerful. Not to mention, that is one way the hardware thinks. :slight_smile:


#11