To locate unreleased or prematurely released interface objects in your application, use the Reference Count profiler. The profiler traces references to objects that implement the IUnknown
interface or its descendants.
To see what COM objects exist in memory after the application run is over, do the following:
-
Profile your application with the Reference Count profiler and get the results upon application termination.
-
In the Explorer panel, select the Objects category.
-
Examine the Report panel. Each row in the panel corresponds to an unreleased object.
-
Check the values of the Total References, Live References and Peak References columns that indicate the total number of references, the current number of references, and the maximum number of references that existed simultaneously.
-
To trace how references to the chosen interface object were created, select the object and switch to the Details panel:
-
View the Creation Call pane to see how the object was created.
-
View the References and AddRef / Release Call Stack panes to see how object references were made and removed.
-
See Also
Memory and Resource Allocation Profiling
Best Practices and How to Tutorials
Reference Count Profiler