Need some help
-
My application "uses" tons of memory. And yes, all of it get's deallocated when program exits. What I would like to do is to find out where all allocation goes too... Application has 100's of classes. Memory allocated by "new" Brian #define new new(_T(_FILE_), _T(_LINE_)) Anyone has class that agregate line above?
-
My application "uses" tons of memory. And yes, all of it get's deallocated when program exits. What I would like to do is to find out where all allocation goes too... Application has 100's of classes. Memory allocated by "new" Brian #define new new(_T(_FILE_), _T(_LINE_)) Anyone has class that agregate line above?
you need to use delete for every variable that you had allocated with new Cheers!!!!:) Carlos Antollini.
-
you need to use delete for every variable that you had allocated with new Cheers!!!!:) Carlos Antollini.
I am not a newbie. No I don't any leaks. I am looking for a way to optimize structures to reduce memry overhead. what does "delete" has to do with this? Brian
-
I am not a newbie. No I don't any leaks. I am looking for a way to optimize structures to reduce memry overhead. what does "delete" has to do with this? Brian
Wow, that was rude. The only thing you can do is delete the pointers as soon as you don't need them any more, but then, you take a chance on fragmenting memory. Other than that, we really can't help you much without seeing the code and analyzing your structures.
-
My application "uses" tons of memory. And yes, all of it get's deallocated when program exits. What I would like to do is to find out where all allocation goes too... Application has 100's of classes. Memory allocated by "new" Brian #define new new(_T(_FILE_), _T(_LINE_)) Anyone has class that agregate line above?
OK, if I understand your question, you're saying that you don't have memory leaks, but you want to know which functions are allocating (and deleting) lots of memory, and which aren't so that you know which ones to optimise? I'm not sure about your redefinition of new, but you could always try profiling your code, and find out how often the constructors of your various classes get called. That should give you some idea of where the most memory is being allocated. Have a look at "profiling" in MSDN for more info. Hope this helps. ------------------------ Derek Waters derek@lj-oz.com