Game Development Community

Torque Constructor Memory Leak

by Andy Hodges · in Torque Game Engine · 06/08/2007 (8:38 am) · 4 replies

I don't know if this was already reported or not, and I can't seem to find a Torque Constructor forum (we really need one!) so I'm posting here.

Before loading a file, the application uses about 40.5k, but then it jumps up to about 400k when loading a file. Which is fine with me, except, when closing the scene/file, the memory never goes down. It stays at 400k.

It's almost as if it doesn't really close the scene/file.

#1
06/08/2007 (8:44 am)
There is a constructor forum Here.

It took me a while to find it at first, I had to edit my forum subscription to show it. You can also hit the view all link at the top of the forums page to see all the forums.

As for the memory leak, I haven't noticed constructor doing that.
#2
06/08/2007 (9:00 am)
Thanks Anthony, I found it! Had to edit my forum subscriptions.
#3
09/06/2008 (6:39 pm)
I get that problem too. And I have a dual core with 4 gigs of ram. Thats why I started to use 3D world studio!
#4
09/06/2008 (7:27 pm)
Constructor is a TGE app, and uses the Torque memory manager to manage memory. What happens behind the scenes with the memory manager when you go to allocate memory, is it looks through a tree for the smallest size free block that will fit your allocation. If it doesn't find one, it will go to the OS and allocate a block of memory. When you free this memory, this is marked as free in the tree (and possibly merged with another block) , but it is NOT released back to the OS. This is just the way that the Torque Memory Manager works.

So in essence, your TGE app will also have allocated the most memory it has ever used, but not more. Take for example constructor - you start up and are using 48mb of RAM. Load the cathedral, and it goes up to 120mb or so (it's a big map). Close the cathedral and the memory is released back to the tree, but not the OS, so your allocated memory is still 120mb. Load the cathedral again, and notice that it has reused the memory - your allocated memory is still the same - there was no leak.

Please note that opening a NEW map will not close the old one. You will just have two scenes loaded. You can switch between them with the dropdown above the scene tree.

(Note also that you necroposted a 15month old thread)