Microsoft KB Archive/814483

= FIX: A memory leak occurs in the VisualBasic.VsaEngine when creating multiple assemblies =

Article ID: 814483

Article Last Modified on 4/7/2006

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio for Applications SDK 1.0

-



SYMPTOMS
When you use Visual Studio for Applications (VSA) in your custom solution and you compile new assemblies that use an instance of the VisualBasic.VsaEngine, you may see an increase in memory for the process working set each time a new assembly is made. The memory cannot be reclaimed by the host. Therefore, the memory is &quot;leaked&quot; by the process space that does the compile.

The problem does not occur when you use the Microsoft JScript VSA engine.



CAUSE
The problem is caused by a combination of three smaller problems. These problems are related to the ability of the Microsoft Visual Basic VSA engine to compile assemblies that are inside the host process. The following problems have been identified as causes for the leak:


 * A COM Callable Wrapper (CCW) that is used during the compile process between the Microsoft .NET Framework and the native Visual Basic compiler may be retained in memory. This occurs even though the object is correctly released. This problem is not specific to VSA. This problem can be avoided if you use the fix that is provided and Close is called on the engine before the engine is released.
 * When symbols are made for the assembly, the program database file (PDB) may consume memory that is not immediately reclaimed by the garbage collector. If you do not require symbols for the compiled code, you can avoid the problem. Set GenerateDebugInfo to False before the Compile method is called.
 * The internal compile process can fail to release certain common language runtime handles during processing of the Visual Basic code. The number of handles that are leaked depends on the code that is compiled. This problem has been resolved by the fix.



Service pack information
To resolve this problem, obtain the latest service pack for Microsoft Visual Studio .NET. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

837234 List of bugs that are fixed in Visual Studio .NET 2002 Service Pack 1

Hotfix information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.   Date         Time   Version         Size       File name ---  15-Feb-2003  00:25  5.50.4134.600   6,428,040  Vs70_qfem_q814483_en.exe



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Visual Studio .NET 2002 Service Pack 1.

Keywords: kbbug kbqfe kbvs2002sp1sweep kbvs2002sp1fix kbhotfixserver KB814483

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.