Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Laurent

DX8 Debug Output (Memory still allocated!)

This topic is 6042 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!