DX 11 Vertex buffer not releasing memory

Started by
5 comments, last by DieterVW 14 years ago
dx 11 version of my engine will not release vertex buffer memory. I create the buffer, Draw the triangle list, free the memory used to create it and then Release the buffer. But from watching the memory usage, the buffer data that is not getting released. I can see the memory impact of whether or not I free the source data, but no effect at all from calling Buffer->Release(). If I don't call it, I get an error for unreleased d3d objects, but memory climb is the same. DX 9 version works fine, but not DX 11. I am trying to call the Buffer->Release right after the Draw call. (just Draw for a single buffer triangle list - no index buffer) Draw works fine, but I quickly run out of memory with large models. Any ideas? David
Advertisement
Quote:
dx 11 version of my engine will not release vertex buffer memory.
I create the buffer, Draw the triangle list, free the memory used to create it and then Release the buffer.

But from watching the memory usage, the buffer data that is not getting released.

What are you using to track memory usage? If the answer is the task manager, then your conclusions are wrong because the task manager is not appropriate for monitoring memory usage in this fashion.

Quote:
Any ideas?

Using the debug runtimes, D3D will happily inform you of any outstanding unreleased objects. If you get no such output, you are releasing everything appropriately, at least as far as D3D cares.
All system memory is consumed, unless I comment out the create buffer, draw and release buffer. Memory usage does not change if I release or do not release the buffer.
Trying to move from 9 to 11.
How can I pinpoint the memory use?

Thanks,
David
Using PIX is a very easy way to check object lifetimes. After running an experiment, you should be able to check the status of every API object that was created by the application - if the buffer is still there and not released, then it will show up in the PIX results.
Run out of GPU memory or CPU memory? -- can you re-use your buffer objects instead of creating/destroying them frequently?
I run out of cpu memory.
While I have fixed buffers for static objects, dynamic loading and purging of objects means I will always be creating new buffers. I'm creating them all now for testing (to get all my multi surface texturing working and to look for bugs).
I don't want to make the rapid memeory loss into a slow leak, until I figure out the cause.
I'm new to DirectX. I've worked with OpenGL for years, but for a game engine I wanted to use DirectX 11 and 9.

David
To whatever extent possible you should try to use existing buffers that have been emptied, and also consider packing several dynamic objects into one buffer if possible. Both of these things will improve performance.

If you run your game with the SDKLayers on, it will report a table at program termination time telling you what objects it still thinks are floating around. You will have to run under a debugger to see the information.

Are you using DX11 multithreading? - There is a bug in defered contexts that can cause a leak in some scenarios. Calling flush works around this issue.

It's possible that there might be a driver bug. Can you try on different hardware or with a different driver?

This topic is closed to new replies.

Advertisement