Bad memory management?

Started by
14 comments, last by uber_n00b 19 years, 10 months ago
OK well I redid everything per the suggestions of everyone here and well, guess what.. it still froze (although my computer sounded a bit less strained). Thank you all though; I wouldn''t have caught those mistakes for several weeks.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
Advertisement
Try starting up the task manager before you launch the debugger; you should be able to monitor memory / page file usage that way.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

When you have an array initially specified as:

**array;

and you allocate it like so:

array = new <type>*[10];for(int i = 0; i < 10; i++)	array[i] = new <type>();


then shouldn't you be deallocating it using:

for(int i = 0; i < 10; i++)	delete array[i]; // NOT delete[] array<br></font><br><br><font color=blue>delete</font>[] array;<br></pre><!–ENDSCRIPT–><br><br>?   <br><br>EDIT: grrr.   <br><br><SPAN CLASS=editedby>[edited by - wavarian on June 5, 2004 2:22:36 AM]</SPAN>
Oh wow, thanks etnu. I looked at the processes running and converting a 512x512 bitmap into a 2*512*512-triangle octree took 266 megs of RAM.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
you could try compiling your application with:

http://www.flipcode.com/cgi-bin/msg.cgi?showThread=12September2000-PresentingAMemoryManager&forum=askmid&id=-1

This will tell you where you are leaking memory, if any.

Good Luck

Willem
Hahahaha. I looked at the site that was just posted here and well.. There''s new memory leaks every frame. I had over a million. So much work that needs to be done.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.

This topic is closed to new replies.

Advertisement