D3DERR_OUTOFVIDEOMEMORY

I am recieving D3DERR_OUTOFVIDEOMEMORY Error, after roughly an hour during the execution of my D3D Application. Any idea what i need to look for

This is the code i use to create my veretexBuffer:

vertexBuffer = new VertexBuffer(typeof(CustomVertex.TransformedColoredTextured),6, d3dDev,Usage.None,CustomVertex.TransformedColoredTextured.Format,Pool.Managed);

I dispose it every time the scene is drawn...

Thanks...



Answer this question

D3DERR_OUTOFVIDEOMEMORY

  • dnenadd

    I was able to figure out the problem. It was from a COM interface from DirectShow movie, that was not being disposed. I was able to locate it be analysing the video memory, from "device.AvailableTextureMemory".

    I think yes... i was really not required to dispose my vertex buffer on every drawscene, rather have now made it stay in the memory, for as long as the life time of that particular articraft


  • Rob Washo

    if you are 100% you are disposing the vertex buffer then its unlikley to be that. (though Pieter is right, its not really a very good idea but it should still work)

    Check out this post by Tom http://blogs.msdn.com/tmiller/archive/2003/11/14/57531.aspx

    Could be that you have some other things that are not disposing

    Now why that would throw a Out of Video Memory is beyond me... that would normally fill up regular memory. However the errors you get back from MDX are not always the most obvious.

    Things to do:

    1. Fire up perfmon and watch the size of the heaps, make sure you choose the app specific counts not the global .Net ones otherwise you might be watching other apps! Provided your app does the same thing over and over you should see the line go up and hit a flat level pretty quickly and then it should stay flat. If it doesn't then suspect something like the event issue above.

    2. What RenderLoop are you using, I have seen accusations (but no proof yet and I can't repro) that the DoEvents loop has this behaviour. The one using Interop is far more efficient anyway so you should switch to that for good measure.

     



  • Kevinbe

    Usually you will dispose vertex buffers and other objects when you are done with them. Disposing the vertex buffer each frame is probably not a good idea. If you want to refill your buffer every frame, i'd suggest looking into dynamic buffers. Have you tried not disposing your buffer every frame What is the result if you do so

    Also, why are you disposing your buffer each frame

    I hope this helps.
    Take care.


  • D3DERR_OUTOFVIDEOMEMORY