The information in this article applies to:
SUMMARYOLE Automation caches the space allocated for BSTR strings. This may cause IMallocSpy to attribute memory leaks to the wrong BSTR user in an application that uses OLE Automation's BSTR strings. The correct source of the leak can be found by disabling OLE Automation's caching by using the debug version of the Oleaut32.dll file and by setting the environment variable OANOCACHE=1 before running the application. MORE INFORMATION
OLE Automation caches the space allocated for BSTRs. This speeds up the
SysAllocString/SysFreeString sequence. However this may cause IMallocSpy
to attribute leaks to the wrong memory user because it is not aware of
the caching done by OLE automation. For example, if the application
allocates a BSTR and frees it, the freed block of memory is put into the
BSTR cache by OLE Automation. If the application then allocates another
BSTR, it may get the free block from the cache. If the second BSTR
allocation is not freed, IMallocSpy will attribute the leak to the first
allocation of the BSTR. The correct leak source (the second allocation)
can be determined by disabling the BSTR caching done by OLE Automation.
This can be done by using the debug version of Oleaut32.dll and by
setting environment variable OANOCACHE=1 before running the application. Additional query words: memory leak
Keywords : kbole kbAutomation kbNTOS351 kbNTOS400 kbWinOS2000 kbWinOS95 kbWinOS98 kbGrpCom kbDSupport LeTwoAto |
Last Reviewed: October 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |