Game Development Community

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.
Page«First 1 2 3 Next»
#41
01/28/2010 (3:00 am)
I really appreciate the work done in this thread. I *KNOW* I've been hit by the leak in the ChunkedTextureManager before. That being said, the code in the post here: http://www.torquepowered.com/community/forums/viewthread/80267/1#comment-563105

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.
#42
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_FIX

is 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_FIX


and similarly, in GuiMessageVectorCtrl::createSpecialMarkers(SpecialMarkers& rSpecial, const char* string),

delete pLCCopy
should be
delete[] pLCCopy
Page«First 1 2 3 Next»