High Memory Utilization - Game Size 36MB uses 700MB of RAM
by Vikram Jhaveri · in Torque Game Builder · 12/13/2009 (7:15 am) · 10 replies
I have made a game of size 36 MB but while running the game it utilizes 700 MB of RAM.
My game has 174 static sprites and 23 animated sprites with design resolution of 800 x 600 and camera resolution the same.
I have tried using the default camera resolution but it didn’t work.
I have made separate data blocks for different scenes and i load and delete the data blocks as i switch between the scenes the objects are getting deleted but the memory utilization is still high and increases if i switch between two scenes continuously.
So, is there any way to dynamically allocate memory to the data blocks?
Is there any way to clear the RAM when i switch between the levels?
My game has 174 static sprites and 23 animated sprites with design resolution of 800 x 600 and camera resolution the same.
I have tried using the default camera resolution but it didn’t work.
I have made separate data blocks for different scenes and i load and delete the data blocks as i switch between the scenes the objects are getting deleted but the memory utilization is still high and increases if i switch between two scenes continuously.
So, is there any way to dynamically allocate memory to the data blocks?
Is there any way to clear the RAM when i switch between the levels?
About the author
#2
Here is something weird that happens. 2 scenes. I keep cycling between just those two scenes. My memory footprint still keeps increasing slowly one MB at a time.
I am willing to dive into the source code. But a little help as to which direction i should hed into, would surely help.
If it can be done without editing the source code, even better.
12/13/2009 (11:23 am)
I am doing a match 3 game. All done and bug tested. Just need to fix this issue. Which is a pretty major issue. Cake Mania 4 which is twice my file size never goes over 200MB of memory. Here is something weird that happens. 2 scenes. I keep cycling between just those two scenes. My memory footprint still keeps increasing slowly one MB at a time.
I am willing to dive into the source code. But a little help as to which direction i should hed into, would surely help.
If it can be done without editing the source code, even better.
#3
12/13/2009 (4:43 pm)
There is a memory footprint fix which should improve things by quite a bit. I think it's time for them to put it in our accounts too :)
#4
12/13/2009 (9:56 pm)
Any idea where i can find this fix. It would be great. Thanks.
#6
I am thinking of getting messy in the source. If i can dynamically load datablocks only when needed and then delete them, it should help a lot.
Any one want to share any of their skills regarding this, would appreciate it.
12/14/2009 (8:35 am)
I just tried that. It did not help unfortunately.I am thinking of getting messy in the source. If i can dynamically load datablocks only when needed and then delete them, it should help a lot.
Any one want to share any of their skills regarding this, would appreciate it.
#7
Typing a lot of code to load and unload datablocks one a time.
It drops memory usage to 200MB.
Any suggestions as to how this can be automated. This data entry work is a buzz kill.
12/15/2009 (1:29 pm)
I have tried a whole lot of solutions. Only one thing works:Typing a lot of code to load and unload datablocks one a time.
It drops memory usage to 200MB.
Any suggestions as to how this can be automated. This data entry work is a buzz kill.
#8
12/15/2009 (1:49 pm)
I am willing to pay for a definite solution. My game is soooo done, just need this final issue fixed. After 1 month of debugging, i cannot believe this is all that is holding me back.
#9
12/15/2009 (2:35 pm)
Vikram., maybe i could help you., shoot me an email at "brunomtc AT hotmail.com".
#10
12/16/2009 (2:29 pm)
You may find the approach outlined here to be useful. All you need to do is group your datablocks into separate files and then exec that file when you need those datablocks and run $levelSpecificDatablocks.delete() when you no longer need them. It's a bit of work but not an overwhelming amount of work and probably easier than trying to automate it.
Torque 3D Owner Ted Southard