Memory Leaks @ Vanilla Torque
by Bullitt Sesariza · in Torque Game Engine · 10/22/2008 (8:18 pm) · 42 replies
Dear Torque Masters,
I am currently investigating unusual high memory consumption in my game after it has been running for long time (a few days). Unable to find any clues, I dug into vanilla Torque Game Engine 1.5.2, starter.fps mod, scripting it to enter the game (via "Start Mission" button), and disconnect from mission (via "Esc" / exit mission). Surprisingly, the memory footprint rises everytime this process is completed - leading to > 2Gb of memory usage in just a few hours, ending in crash.
I've followed the resources from http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9641, flagging the memory allocation during the game startup and dumping the memory leaks during game shutdown and get thousands of leak alerts, some of which I can confidently filtered out but a lot that I have no idea of.
Does anyone ever encounter this problem, or could it possibly just my "misconfiguration" of the engine? Could anybody point me to the direction where I can get rid of the leak alerts, it is difficult and very time consuming to check each line of the codes that possibly introduce the leak as there are hardly any 'source-code-documentation' within the engine.
Any help is highly appreciated, thank you for your kind attention.
I am currently investigating unusual high memory consumption in my game after it has been running for long time (a few days). Unable to find any clues, I dug into vanilla Torque Game Engine 1.5.2, starter.fps mod, scripting it to enter the game (via "Start Mission" button), and disconnect from mission (via "Esc" / exit mission). Surprisingly, the memory footprint rises everytime this process is completed - leading to > 2Gb of memory usage in just a few hours, ending in crash.
I've followed the resources from http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9641, flagging the memory allocation during the game startup and dumping the memory leaks during game shutdown and get thousands of leak alerts, some of which I can confidently filtered out but a lot that I have no idea of.
Does anyone ever encounter this problem, or could it possibly just my "misconfiguration" of the engine? Could anybody point me to the direction where I can get rid of the leak alerts, it is difficult and very time consuming to check each line of the codes that possibly introduce the leak as there are hardly any 'source-code-documentation' within the engine.
Any help is highly appreciated, thank you for your kind attention.
#42
is incorrect. mBinArray is an array, and should be deleted with
and similarly, in GuiMessageVectorCtrl::createSpecialMarkers(SpecialMarkers& rSpecial, const char* string),
02/06/2010 (12:08 pm)
Hey, I found another error in the code in this thread.Container::~Container()
{
// + KIM 081105 LEAK_FIX
if ( mBinArray )
{
delete mBinArray;
mBinArray = NULL;
}
// - KIM 081105 LEAK_FIXis incorrect. mBinArray is an array, and should be deleted with
Container::~Container()
{
// + KIM 081105 LEAK_FIX
if ( mBinArray )
{
delete[] mBinArray;
mBinArray = NULL;
}
// - KIM 081105 LEAK_FIXand similarly, in GuiMessageVectorCtrl::createSpecialMarkers(SpecialMarkers& rSpecial, const char* string),
delete pLCCopyshould be
delete[] pLCCopy
Torque 3D Owner Thomas "elfprince13" Dickerson
Seems to very badly break my ability to load datablocks with validators. Perhaps the same validator is reused across multiple Fields? I noticed that my crash was occurring in code with an if( somevarorother->validator) doSomethingWithTheValidator.