Wizfrog
2009-05-29 02:03:23 UTC
Hello,
I'm having a problem with my app using DirectX in C#.
After a while, I run into OutOfVideoMemory errors even though I am
always using the same amount of data, and I make sure to .Dispose() my
textures, vertexbuffers etc...
So I don't get it. Isn't the Garbage collector supposed to figure out
when the device may run out of memory and flush the space as needed?
I understand that in Managed code, the GC may not flush right when I
ask it to, but it should do so as soon as possible and get rid of
objects to leave room for others.
Now I also undersatand that with the GPU, everything is 'unmanaged' so
to speak, since one needs to 'lock' buffers, texture areas etc... to
write to / read from them.
...but how am I supposed to 'clear' these buffers then, if I am to do
it myself? Assigning a null value doesn't seem to do it.
Thanks for help!!!
I'm having a problem with my app using DirectX in C#.
After a while, I run into OutOfVideoMemory errors even though I am
always using the same amount of data, and I make sure to .Dispose() my
textures, vertexbuffers etc...
So I don't get it. Isn't the Garbage collector supposed to figure out
when the device may run out of memory and flush the space as needed?
I understand that in Managed code, the GC may not flush right when I
ask it to, but it should do so as soon as possible and get rid of
objects to leave room for others.
Now I also undersatand that with the GPU, everything is 'unmanaged' so
to speak, since one needs to 'lock' buffers, texture areas etc... to
write to / read from them.
...but how am I supposed to 'clear' these buffers then, if I am to do
it myself? Assigning a null value doesn't seem to do it.
Thanks for help!!!