Game Development Community

Texture Object leak

by Randy Hearn - Magnum · in Torque Game Engine Advanced · 03/30/2008 (8:55 am) · 4 replies

Not sure whether this is a BUG with TGEA 1.7 Beta 2, or just somthing I have setup in my compiler VS 2005++ Express. Forgedemo works fine if I play the compiled version in the kit. However, after I compiled it I get the error below when I exit the demo.

*** ENDING MISSION
Exporting server prefs...
Exporting client prefs
Exporting server prefs
Cur. D3DDevice ref count=1
GFXTextureObject Usage Report - 11 active TOs
---------------------------------------------------------------
Addr Dim. GFXTextureProfile Profiler Path
5e598b8 ( 128, 128) GFXDefaultStaticDiffuseProfile na
5e597f0 ( 4, 4) GFXDefaultStaticDiffuseProfile na
5e59728 ( 256, 256) GFXDefaultStaticDiffuseProfile na
5e595d0 ( 50, 37) DRLTargetTextureProfile na
5e59508 ( 50, 37) DRLTargetTextureProfile na
5e59440 ( 1, 1) DRLTargetTextureProfile na
5e59378 ( 3, 2) DRLTargetTextureProfile na
5e592b0 ( 12, 9) DRLTargetTextureProfile na
5e591e8 ( 50, 37) DRLTargetTextureProfile na
5e59120 ( 200, 150) DRLTargetTextureProfile na
5e59058 ( 800, 600) DRLTargetTextureProfile na
----- dump complete -------------------------------------------
Fatal: (c:\torque\tgea_1_7_0_beta_2\engine\source\gfx\gfxtextureobject.cpp @ 36) There is a texture object leak, check the log for more details.

About the author

Technical Product Designer (Mechanical Design) for Boeing for over 25 years working with CAD and PLM systems. I have a Associates Degree in Business and a partial B.S. in Game and Simulation, just couldn't see paying the costs for some of the classes.


#1
03/30/2008 (9:37 am)
Honestly, there is an error somewhere in the mission that is causing a texture leak, but since it's intended as a small demo, we didn't spend the resources to track it down exactly and correct. Of course, once you end the demo completely, the memory that is leaked is released back to the operating system, so for this particular scenario it's not a huge deal.

The warning you are getting should be from a debug build, which gives additional information in tracking down this type of issue (as you can see), and this bug is on the list for the next point release in the future.

If you do receive this type of warning in a debug build of a game undergoing production, you should of course be aware of the issue, and track down your bug before releasing your game.
#2
03/30/2008 (9:38 am)
This means that some object is not cleaning up its texture handles. It has nothing to do with your compiler.

In the "DRLTargetTextureProfile" cases, a search shows that it only exists in one place - sgDRLSurfaceChain - so either it's not cleaning itself up properly, or instances of it are not being cleaned up.

The others are more generic, so to find out more, you can turn on profiler paths [TORQUE_ENABLE_PROFILE_PATH - you'll have to recompile], enable the profiler, run the mission, and let it crash. The "na" at the end of each of those lines should be filled in with the profiler path [if any] to point you in the right direction. You can add more profile blocks as necessary to narrow it down.

Usually the fix for these is to assign the texture handles to NULL when destroying the object which declares them.
#3
03/30/2008 (9:46 am)
Thanks for the quick replies.... And on a Sunday as well:)

Bottom line is it's no big deal. I am not very familiar with texture leaks. But hey, gives me something tho play with.

Just wanted to make sure it wasn't something I had mest up in recompiling.


Thanks a bunch
#4
03/30/2008 (10:29 am)
I don't remember the exact cause, but when we triaged this bug, it had something to do with the order we were cleaning up the mission during mission end--something to the order of deleting objects directly before they were removed from the scene, or along those lines.

That's -totally- from memory, and a vague one at that, so don't take it as gospel ;)