Level Datablocks and Memory
by Joe Virgin · in iTorque 2D · 02/12/2010 (4:11 pm) · 1 replies
It is my understanding that Torque doesn't release memory. I'm thus a little confused on how level datablocks are efficient. I have a few questions about level datablocks and memory.
1. If a level is unloaded via "sceneWindow2D.endLevel();", are the datablocks associated with that level (assuming allowUnload = true) released from memory?
2. Does reloading a level double the amount of datablocks?
3. Is it possible to release memory by deleting the $levelDatablocks simSet?
Thanks in advance.
1. If a level is unloaded via "sceneWindow2D.endLevel();", are the datablocks associated with that level (assuming allowUnload = true) released from memory?
2. Does reloading a level double the amount of datablocks?
3. Is it possible to release memory by deleting the $levelDatablocks simSet?
Thanks in advance.
About the author
Joe Virgin is a programmer for Plainvue Software, Inc., a company producing iPhone games that teach math skills to the youth. Check out Fraction's Kitchen Lite, Fortune's Prime, and Chainshooter powered by iTGB and now available on the App Store.
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
2. If you don't release them before then yes.
3. You would better iterate through it and remove the datablocks and leave the simset as you will need it again. Someone posted a short function for this.
the reason mentioned why it does not automatically clean is that you only want to remove the datablocks not needed in the next level. there is no reason to remove all if 90% are needed again as datablock initialize is a fairly time costly thing