Hello everyone!
I am currently fighting with a memory leak in my project, and I stripped it down to creating and releasing a ConstantBuffer.
Since these particular buffers get created during load-time, I added some test-code to check if this really was the problem.
The game starts the following code with approx. 400mb of used RAM, and eventually crashes at about 1.7gb:
for(int i=0;i<INT_MAX;i++)
{
VS_ExConstantBuffer_PerInstance dt; // Just some 64-byte sized struct
// Init cb
D3D11_SUBRESOURCE_DATA d;
d.pSysMem = &dt;
d.SysMemPitch = 0;
d.SysMemSlicePitch = 0;
// Create constantbuffer
ID3D11Buffer* buffer;
device->CreateBuffer(&CD3D11_BUFFER_DESC(sizeof(VS_ExConstantBuffer_PerInstance), D3D11_BIND_CONSTANT_BUFFER), &d, &buffer);
// Release it again
buffer->Release();
}
So, the only thing this does is creating and releasing an ID3D11Buffer over and over again, and that should keep the memory-consumption on an even level, right?
I really don't know any further here, what could even cause such a problem?