Sign in to follow this  

Debuggin memory leaks in Managed DX

This topic is 3738 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

Hi there! I'm experiencing some memory leaks in my application. I've enabled the DirectX Debug runtime and made it stop on the leaks, so I get the final report on the leaks after the Memfini debug message and my application stopped on the debugger at that point, but I was not able to find how to progress further. My report looks like this: Direct3D9: (INFO) :MemFini! Direct3D9: (ERROR) :Memory still allocated! Alloc count = 157 Direct3D9: (ERROR) :Current Process (pid) = 0000114c Direct3D9: (ERROR) :Memory Address: 025a07f4 lAllocID=1 dwSize=00004bc4, ReturnAddr=6bbf99aa (pid=0000114c) (...) Direct3D9: (ERROR) :Memory Address: 05834d3c lAllocID=284 dwSize=0000007c, ReturnAddr=6bc15d24 (pid=0000114c) Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 540328 bytes Could someone provide me with some info on how to debug it, on how could I get to know what objects area leaking? I googled a little but did not find proper info :( TIA, Pablo

Share this post


Link to post
Share on other sites
Scroll down the list, find the first lAllocID value (1 in this case; it's something you allocate very early like the device itself). Set "break on AllocID" in the DX control panel to that value. You will then trigger a breakpoint at runtime when you allocate that object.

Alternatively, switch on over to SlimDX, which provides a more user-friendly debug dump when you forget to Dispose() a resource (it allows you to click on the error message and be transported to the initialization of the object you leaked, much like you can with compile errors).

Share this post


Link to post
Share on other sites
Thanks a lot, jpetrie! I've just checked it and well, the breakpoint on the first allocID that appears on the list (in fact, the first allocation of them all) is showing something I'll have to investigate further. It is breaking on this line, just when it's getting the current display mode!



this.displayMode = Manager.Adapters[0].CurrentDisplayMode;




Thanks a lot for the info on SlimDX, I'll take a lookt at it, sounds nice!

Share this post


Link to post
Share on other sites

This topic is 3738 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this