Sign in to follow this  
xegoth

Fixing memory leaks.

Recommended Posts

xegoth    154
I've got a memory leak that I can't track down for the life of me. Is there any free software out there that'd help me find it? I'm using Microsoft Visual Studio .net and DX 9.0c

Share this post


Link to post
Share on other sites
Supernat02    604
How are you being informed that you have a memory leak? i.e. is the DirectX Debug telling you? Is it crashing your software? What're the symptoms and maybe we can help? Some things to keep in mind. You should release all COM objects, even ones you didn't create (unless they are released elsewhere). An example of this is the D3DXBUFFER(I forget the exact COM) that is created when using D3DXLoadMeshFromX function. You create a pointer to a buffer at design-time, pass the address of the pointer to the function which then fills the pointer at run-time. Then you must release this when you're done. There are quite a few places in DirectX where you must release something you didn't specifically create. You didn't specifically call a CreateBuffer function, but you do have to release it. Off the top of my head, make sure you release at least these: Cursors, surfaces, textures, meshes, materials, buffers, vertex and index buffers, etc.

Chris

Share this post


Link to post
Share on other sites
ogracian    180
Hi, well about a free code you could use to track mem leaks, I suggest you check the fluid studios memory manager, it is a really easy to use industrial strenght mem leaks tracker.

Check it out in the following link:
http://www.fluidstudios.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip

Regards,
Oscar

Share this post


Link to post
Share on other sites
Muhammad Haggag    1358
Quote:
Original post by ogracian
Hi, well about a free code you could use to track mem leaks, I suggest you check the fluid studios memory manager, it is a really easy to use industrial strenght mem leaks tracker.

- If you have VC++, it already has such functionality (lookup _CrtSetDbgFlag or something)
- This won't work with DirectX (COM) memory leaks

Share this post


Link to post
Share on other sites

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