Article ID: 264957 - Last Review: December 5, 2007 - Revision: 1.6 PRB: Visual Basic DLL Has Memory Leaks and Crashes in COM+ If 'Retain In Memory' Is Not SetThis article was previously published under Q264957 SYMPTOMSThe Visual Basic 6.0 ActiveX DLL may cause COM+ applications
and Active Server Pages (ASP) to stop responding (crash or hang) if you do not
select the Unattended Execution and Retain in
Memory options. CAUSE Visual Basic runtime behaves differently based on whether
you select the Unattended Execution and the Retain in
Memory options are selected. When you do not select these options, the
Visual Basic runtime unloads custom and runtime DLLs unexpectedly, which causes
the computer to stop responding (crash or hang) under some multithreaded
scenarios. Typical scenarios include when you place the ActiveX DLL in COM+ or
Microsoft Transaction Server (MTS), or when you call the ActiveX DLL from ASP
pages. Note As in many multithreading issues, the symptoms may only manifest themselves under very specific and transient conditions. RESOLUTION To resolve this problem, set the Retain In
Memory option as follows:
Note Before Service Pack 3 for Visual Studio 6.0, it was possible to get an access violation during process shutdown with Retain in Memory enabled. This has been fixed in Visual Studio 6.0, Service Pack 3 or later (http://www.microsoft.com/downloads/details.aspx?FamilyID=A8494EDB-2E89-4676-A16A-5C5477CB9713&displaylang=en) . STATUS This
behavior is by design. Note In Visual Studio 6, Service Pack 5, when a project contains any public class that has MTSTransactionMode set to anything other than 0, the Unattended Execution and Retain In Memory options are automatically selected. REFERENCES For a comprehensive list of guidelines and tips about how
to develop COM+ applications with Visual Basic, visit the following Microsoft
Developer Network (MSDN) Web site: http://msdn.microsoft.com/en-us/library/ms809241.aspx
(http://msdn.microsoft.com/en-us/library/ms809241.aspx)
For additional information on threading issues with
Visual Basic 6.0 ActiveX components, click the article number below to view the
article in the Microsoft Knowledge Base: 241896
(http://support.microsoft.com/kb/241896/EN-US/
)
PRB: Threading Issues with Visual Basic 6.0 ActiveX Components
For additional information on threading issues with
Visual Basic 5.0 ActiveX components, see the following article:
186273
(http://support.microsoft.com/kb/186273/EN-US/
)
BUG: AV Running VB-Built Component in Multi-Threaded Environment
| Article Translations
|
Back to the top
