• Advertisement
Sign in to follow this  

Fixing memory leaks.

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

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
Advertisement
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
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
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
The DirectX Debugger is informing me of the memory leak. It's small but bad all the same.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement