Torque X huge memory leak - Fixed
by Giuseppe De Francesco · in Torque X 2D · 03/18/2010 (11:54 am) · 298 replies
Well,
I'm not sure this is the right place to post this, maybe the blog? At any rate I'm posting here now.
Torque X has a huge memory leak, but seriously! I was working to a RPG game for a start so I didn't really notice, but 2 weeks ago I started YASS, a multiplayer side scrolling space shooter: a lot of particles, really a lot, and a lot of projectiles as well.
To let you understand here follows a short video of the game:
This is the memory situation after 3 minutes of gameplay (single player!!!) the game slowed down a lot:

So, I searched the forum and I realized that this issue is an old one and GG never got a grip on it (go figure why...) so I decided to fix the problems myself because I really need to publish YASS ;)
Long story short: I revised the whole engine and made a lot of fixes, some of them really of great importance, so here it is the situation playing my game (as you can see after 9 minutes the game still is 20% less than the original 3 minutes!):

There are still many stuff to fix, but at any rate in the current state I'm able to publish the game ;) I will make the SVN diff files available upon request (free of charge: pino AT dftgames DOT com).
Cheers,
Pino
I'm not sure this is the right place to post this, maybe the blog? At any rate I'm posting here now.
Torque X has a huge memory leak, but seriously! I was working to a RPG game for a start so I didn't really notice, but 2 weeks ago I started YASS, a multiplayer side scrolling space shooter: a lot of particles, really a lot, and a lot of projectiles as well.
To let you understand here follows a short video of the game:
This is the memory situation after 3 minutes of gameplay (single player!!!) the game slowed down a lot:

So, I searched the forum and I realized that this issue is an old one and GG never got a grip on it (go figure why...) so I decided to fix the problems myself because I really need to publish YASS ;)
Long story short: I revised the whole engine and made a lot of fixes, some of them really of great importance, so here it is the situation playing my game (as you can see after 9 minutes the game still is 20% less than the original 3 minutes!):

There are still many stuff to fix, but at any rate in the current state I'm able to publish the game ;) I will make the SVN diff files available upon request (free of charge: pino AT dftgames DOT com).
Cheers,
Pino
About the author
In the software eng. field since 1981, in charge of R&D during last 10 years. IEEE Senior Member (and volunteer).
#262
I used to create my own global randoms and such until I found the randoms in Util/General
05/16/2010 (10:47 am)
@pino Yea I saw that in there as well but have not yet messed with it. There is a bunch of stuff in the engines that are either undocumented or just forgotten about. That entire Util folder is full of gems.I used to create my own global randoms and such until I found the randoms in Util/General
#263
05/16/2010 (11:38 am)
@pino I do not know if that is the same FSM class used in the platformer kit, but the platformer kit has one as well as some documentation on it.
#264
05/16/2010 (12:11 pm)
Henry, yes is the very same class. I think it was written for the platformer starter kit then imported into the Torque Utils. It's very basic so to use it it needs some addition.
#265
Again guys, thanks for the community work, much appreciated.
05/16/2010 (8:20 pm)
Talking about that, any chance to create a svn for the Platformer SDK? I'd love to share any fixes I manage to make to it and I'm sure I'm not the only one. ^^Again guys, thanks for the community work, much appreciated.
#266
the issue here is that the Platform Starter Kit doesn't show in the list of the products owned so it'll be impossible for me to verify the license ownership before to add people to the repository.
I'd love to do that so... maybe we can ask GG guys to make it happen :)
05/16/2010 (11:00 pm)
Hi Olivier,the issue here is that the Platform Starter Kit doesn't show in the list of the products owned so it'll be impossible for me to verify the license ownership before to add people to the repository.
I'd love to do that so... maybe we can ask GG guys to make it happen :)
#267
Thanks!
05/17/2010 (10:51 am)
Just finished reading through all of these posts, it's incredible the amount of work that has gone into this. I'd love to be a part of it,and would greatly appreciate an add. My email is : malandra12[at]yahoo.com.Thanks!
#269
just to give you an update.
I'm now working on optimizing the code. Till now I've added a few changes that result in frame rate increased by no less than 10% respect last SVN commit. I'll commit these new improvement by the end of the week.
Pino
05/25/2010 (12:41 pm)
Hey guys,just to give you an update.
I'm now working on optimizing the code. Till now I've added a few changes that result in frame rate increased by no less than 10% respect last SVN commit. I'll commit these new improvement by the end of the week.
Pino
#270
05/31/2010 (6:52 am)
Great job, can't wait to take a look at these changes you've made, and add them to my project. willxisxveganx AT gmail DOT com
#271
I have started to dig into torque core to understand how it works before doing anything else. Of course questions (like why that and why there, etc) started to pop up. And then I found this thread. Amazing stuff for sure.
Two things if anyone wants to help:
a) does the latest TX 2D sources (guess it's 3.1.4.0) include all these fixes you've been so nice to make available?
b) if not, is there any way to get to those changes? my email is w0land at hotmail dot com (please excuse if I'm asking too much).
Lucian
06/01/2010 (3:30 am)
Hi everyone!I have started to dig into torque core to understand how it works before doing anything else. Of course questions (like why that and why there, etc) started to pop up. And then I found this thread. Amazing stuff for sure.
Two things if anyone wants to help:
a) does the latest TX 2D sources (guess it's 3.1.4.0) include all these fixes you've been so nice to make available?
b) if not, is there any way to get to those changes? my email is w0land at hotmail dot com (please excuse if I'm asking too much).
Lucian
#272
the 3.1.4 is the one I've been working on. Next release will contain hopefully all this and much more fixes. I'll send you know the inviration letters to the SVN repositories: you need to accept all of them to get full access to patched engine.
When you have access don't forget to go in your SVN user preferences and turn on the email notifications to be sure to stay up to date ;)
Pino
06/01/2010 (8:22 am)
Hey Lucian,the 3.1.4 is the one I've been working on. Next release will contain hopefully all this and much more fixes. I'll send you know the inviration letters to the SVN repositories: you need to accept all of them to get full access to patched engine.
When you have access don't forget to go in your SVN user preferences and turn on the email notifications to be sure to stay up to date ;)
Pino
#273
thanks a lot for all your efforts. Could you please also sent me the invitations? The email is andi.schaerrer at gmail.com
Thanks
Andi
06/01/2010 (12:25 pm)
Pino,thanks a lot for all your efforts. Could you please also sent me the invitations? The email is andi.schaerrer at gmail.com
Thanks
Andi
#274
http://www.torquepowered.com/community/blogs/view/19831
06/01/2010 (12:27 pm)
Since there is a huge numbers of followers on this thread, I thought I would cross-link the blog that Derek just posted.http://www.torquepowered.com/community/blogs/view/19831
#275
@Andi: I'm going to send the invitation right away ;)
06/01/2010 (12:56 pm)
@Eric: thanks, that's great news ;)@Andi: I'm going to send the invitation right away ;)
#276
I run WIN7 X64 Ultimate, VS2008 Prof. I just downloaded the updated files from the svn, then copied it over the original TorqueX installation.
Any idea what is wrong?
06/05/2010 (4:12 am)
Thanks a lot Pino. However, I get problems with the TorqueXMLSchema. Whenever I start a new project, then build it, I only have the movementcomponent available in TXBuilder, all other components are just missing.I run WIN7 X64 Ultimate, VS2008 Prof. I just downloaded the updated files from the svn, then copied it over the original TorqueX installation.
Any idea what is wrong?
#277
quite strange actually. I run a similar config (Win7 X32 Ultimate + VS2008 Architect) but I don't think the problem is related to the environment. This is what I usually do:
I create a TX project then I remove the local copies and add the projects from the original installation location bith Win and Xbox projects (I don't see why I should have many copies of the angine) then I create the Xbox copy of the game and I add the proper references to the games' project, then I revise as usual the configuration manager to set the compilations properly.
Is it possible that you missed some file? How did you get the files from the repositories? the best way is to rename the original and recreate the folders as SVN working copy using TortoiseSVN. Did you add full access permissions to the installation folder? this also can create problems pointing at the sources.
06/05/2010 (12:19 pm)
Hey Andi,quite strange actually. I run a similar config (Win7 X32 Ultimate + VS2008 Architect) but I don't think the problem is related to the environment. This is what I usually do:
I create a TX project then I remove the local copies and add the projects from the original installation location bith Win and Xbox projects (I don't see why I should have many copies of the angine) then I create the Xbox copy of the game and I add the proper references to the games' project, then I revise as usual the configuration manager to set the compilations properly.
Is it possible that you missed some file? How did you get the files from the repositories? the best way is to rename the original and recreate the folders as SVN working copy using TortoiseSVN. Did you add full access permissions to the installation folder? this also can create problems pointing at the sources.
#278
06/05/2010 (12:59 pm)
I don't know how it could compile and yet not expose any of the components.
#279
This shouldn't be an issue for the Torque X components in a fresh install and update from the svn though. Sounds like it's time to start from a clean slate again and see if that gets rid of the issue.
06/05/2010 (2:07 pm)
@Henry: Torque X needs to know about the assemblies that the components are in or the schema will not know to include them.This shouldn't be an issue for the Torque X components in a fresh install and update from the svn though. Sounds like it's time to start from a clean slate again and see if that gets rid of the issue.
#280
Man I cannot tell you how much I miss the particle effect editor in TX2D. I wonder if there is an editor in T3D.
06/05/2010 (7:09 pm)
Doing some TX3D stuff and found a small issue, in T3DParticleEmitter::CopyTo it is missing the lineobj2.Effect = Effect;
Man I cannot tell you how much I miss the particle effect editor in TX2D. I wonder if there is an editor in T3D.
Torque Owner Christopher L Hill