- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Inspector's "Detect Memory Problems" and "Locate Memory Problems" lists multiple memory leaks, kernel resource leaks, etc. related to DirectX. The following code should reproduce what I'm seeing:
[cpp]#includeint main() { IDirect3D9 *pD3D = Direct3DCreate9(D3D_SDK_VERSION); pD3D->Release(); return 0; } [/cpp]
If the create/release are placed in a loop, Process Explorer shows that memory and handle use increases for the first iterations, but the increase slows quickly -- once a peak is reached there are no further increases.
Is this behavior due to Inspector's interactions with resource caching within DirectX? DirectX does not report any memory leaks, and otherwise appears to be functioning correctly in its original context. What is causing Inspector to report these issues?
Thanks for your help.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this problem after installing the Microsoft DirectX SDK (June 2010) - then built a simple test case, ran Inspector XE 2011 Update 5 (build 180252), it detected "Kernel resource leak", actually it waswrong report since we have "pD3D->Release();"
Is it possible that Inspector hasn't detected (tracked) resource release in pD3D->Release()?
[cpp]#include "stdafx.h" #include#include #include void loop_foo() { for (int i=0; i<3; i++) { IDirect3D9 *pD3D = Direct3DCreate9(D3D_SDK_VERSION); pD3D->Release(); } } int _tmain(int argc, _TCHAR* argv[]) { //IDirect3D9 *pD3D = Direct3DCreate9(D3D_SDK_VERSION); //pD3D->Release(); loop_foo(); return 0; } [/cpp]
I will report this to dev team, and post again if there is progressor solution.
Regards, Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reported resource leaks are suppressed since it's DirectX3D internal and irrelevant to user's app.
This is not a bug in product, and just add MC suppression to ignore (not report) them.
Regards, Peter
This is not a bug in product, and just add MC suppression to ignore (not report) them.
Regards, Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are creating a COM interface. I was under the impression that leaks within COM objects were not detected. Am I incorrect? If so, I'd really love to profile some of the COM objects in my solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like the bug in DirectX3d for allocating COM objectand release it quickly, repeat it at next iteration in a loop. Some kernel resource still was notreleasedbut the user apply it again...
If yoursolutiondoesn't work in this way, you don't care of this issue; If you allocate/releasesame COM objects frequently (e.g. inloop), use Suppression for "kernel resource" in order not to report them - but memory check still can work smoothly.
Regards, Peter
If yoursolutiondoesn't work in this way, you don't care of this issue; If you allocate/releasesame COM objects frequently (e.g. inloop), use Suppression for "kernel resource" in order not to report them - but memory check still can work smoothly.
Regards, Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting Peter Wang (Intel)
It looks like the bug in DirectX3d for allocating COM object...
It is hard to believe that Microsoft has a problem here because that method is a fundamental one.
Best regards,
Sergey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page