问题
I have a test that shows memory leak in my app:
RAM usage increases 30-40MB per iteration, the profiler shows it’s in external code.
Between the iterations, I shut down & then recreate D3D device. When I stopped doing that and just kept the device alive, it became good:
The only difference is 2 interface pointers: ID3D11Device
, and IMFDXGIDeviceManager
.
Is there a way to shutdown a D3D device so it releases the memory instead of leaking?
As far as I understand, if I would have leaked a resource pointer somewhere, it would continue leaking with an old device. Does it mean the problem is in Windows 10, not in my code? For now, I obviously keeping the device alive, but ideally I’d like a way to implement clean shutdown.
来源:https://stackoverflow.com/questions/52529016/is-it-possible-to-shut-down-a-d3d-device