Possible memory leak?
by torque4a · in Torque Game Builder · 10/24/2006 (7:26 am) · 4 replies
Hi guys, I'm back again with perhaps a silly question.
Is there a way to list all of the objects running in a TGB game? I don't want the sceneObjects, or items linked to a scene object, but I need to see if there's a memory leak in my code, I'm currently performing lots of calculations using SimSets and SimGroups, I'm even checked that I'm deleting said objects in the SimSets, because SimGroups automatically delete all of the objects in it's Group right?
I just use a while loop to clear out the one SimSet I'm using. Why the one SimSet? It don't need to delete /every/ object at once in it. So... in short, after about 10-15 mins of playing, my game crashes, running out of memory, but I can't find any extra objects?
I've even tested this code by developing it in C++, line for line (with a few extra for variable types) I have no memory leaking. Memory goes up and down just fine... somethings happening in TGB :-(
So if anyone knows how to see all of the objects created in TGB, please help.
Is there a way to list all of the objects running in a TGB game? I don't want the sceneObjects, or items linked to a scene object, but I need to see if there's a memory leak in my code, I'm currently performing lots of calculations using SimSets and SimGroups, I'm even checked that I'm deleting said objects in the SimSets, because SimGroups automatically delete all of the objects in it's Group right?
I just use a while loop to clear out the one SimSet I'm using. Why the one SimSet? It don't need to delete /every/ object at once in it. So... in short, after about 10-15 mins of playing, my game crashes, running out of memory, but I can't find any extra objects?
I've even tested this code by developing it in C++, line for line (with a few extra for variable types) I have no memory leaking. Memory goes up and down just fine... somethings happening in TGB :-(
So if anyone knows how to see all of the objects created in TGB, please help.
About the author
#2
10/24/2006 (9:27 am)
Maybe you are having the same problem than I have, is probably not the objects, but the schedules, check the console to see if some schedule is running after the game is done.
#3
10/24/2006 (1:32 pm)
Would love to, unfortunately, I have /no/ schedules in my game... execept for level loading... but they're 2ms long. And those are working, or my game wouldn't switch levels without them.
#4
Maybe theres a bug and LoadLevel does not always use the endlevel command, Im not sure.
10/26/2006 (11:36 am)
}Hmm.. two details use sceneWindow2d.endLevel BEFORE loading leves, loadlevel is supposed to use that command automatically but after several tests Ive noticed that it works better if you use it yourself.Maybe theres a bug and LoadLevel does not always use the endlevel command, Im not sure.
Torque Owner Ben R Vesco