DX8 Debug Output (Memory still allocated!)

Started by
4 comments, last by Laurent 22 years, 3 months ago
Hello there, Since I have ported my code to DX 8.1, I have the following debug output on exit of my little game. The thread 0x6E8 has exited with code 0 (0x0). Direct3D8: (ERROR) :Memory still allocated! Alloc count = 292 Direct3D8: (ERROR) :Current Process (pid) = 000007cc Direct3D8: (ERROR) :Memory Address: 0032459c lAllocID=1 dwSize=00003524, ReturnAddr=00b5e226 (pid=000007cc) Direct3D8: (ERROR) :Memory Address: 00328d3c lAllocID=8 dwSize=00000b64, ReturnAddr=00b4f034 (pid=000007cc) Direct3D8: (ERROR) :Memory Address: 003298d4 lAllocID=9 dwSize=000006a0, ReturnAddr=00b5231b (pid=000007cc) etc... Anyone knows how to use the info above to fix the problem? How can I track this AllocID? Thank you in advance. PS: The source code of the whole thing can be downloaded from http://lafaqmfc.com/starshooter.htm
Advertisement
quote:
How can I track this AllocID?


With the debug version of the SDK, take a look at the DirectX applet in the Windows control panel - in particular the Direct3D tab. You''ll notice "Break on Memory Leaks" and "Break on AllocID", these cause breakpoints in your code which will break into the debugger when the offending allocations are made. All you do then is look down the call stack and work out why that particular allocation has been leaked.

Usually: make sure you keep a close eye on reference counts for all COM interfaces - some of the Get* functions bump up the ref counts, as do some of the Set* functions.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

The cool thing is that it also tracks dynamic memory that you used, so not only look for D3D stuff, but make sure that you reclaim the memory that you forgot about, this is important in a game that has a changing environment, small leaks like that can eventually degrade performance as they multiply.

-------
Happy Coding!
Homepage: www.pcwebvia.f2s.com CVS1.0 will be released soon here.
www.bytamin-c.com
-------Homepage: http://www.pclx.com
Simon: I don''t have anything about "Break on..." in my D3D tab, just "Allow Hardware Acceleration", "Enumerate Ramp Rasterizer", and "Enumerate Reference Rasterizer". Am i looking in the wrong place? Or do you have some special developer version of DX8?

Cheers, Steve
Steveyboy:

this is only in DirectX 8.1.

Also you need to make sure you have the *DEBUG* D3D runtime installed - when you install the full SDK, you get an option of whether you want to use the Debug (slower, but better for development) SDK or the Retail (faster, but less error tolerant) SDK. Those things only appear in the *debug* SDK.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Ah, i''ve only got DX8.0.
I think i''ll wait for DX9, i can''t face the prospect of downloading the monolithic DX SDK on a 56K dialup again...

Ta, Steve

This topic is closed to new replies.

Advertisement