FIX: Memory Leak When Field in Recordset Has More Than 16K of Data

ID: Q236574


The information in this article applies to:
  • Microsoft OLE DB, version 2.1
  • Microsoft Data Access Components versions 2.1, 2.1 (GA), 2.1 SP1, 2.5


SYMPTOMS

When using a Recordset that has been created by appending fields to a Recordset object (a "creatable" recordset), and when any text fields in the recordset contain more than 16K of data, a memory leak occurs when setting the value of the field. The memory leak occurs regardless of what the field's Size property has been defined to be, as long as the size of the actual data is more than 16K.


CAUSE

When the amount of data being assigned to a field value is more than 16K, the Data Conversion Library creates a scratch buffer to work with. The buffer is not released.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next Microsoft Data Access Components Service Pack 3 that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The English version of this fix should have the following file attributes or later:


   Date      Version      Size    File name     
   -------------------------------------------

   7/2/99    02.10.4302   359KB   oledb32.dll
 


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION




Manual Installation

  1. Close or stop any applications or services that are using the oledb32.dll file. This may include Internet Information Server (IIS), Microsoft Transaction Server (MTS), Microsoft Distributed Transaction Coordinator (DTC), and any ActiveX Data Objects (ADO) or OLE DB applications.


  2. Download the hotfix version of oledb32.dll into a temporary directory.


  3. Locate and rename the current version of oledb32.dll, which should be in the \Program Files\Common files\System\ole db folder.


  4. Copy the hotfix version of oledb32.dll into the same location, and restart your services and applications.


Important Notice for Microsoft Windows 95 and Windows 98 Users

If you are installing this fix onto a computer running Windows 95 or a computer with the original release of Windows 98, you may need to install the Windows 98 Migration DLL included with this fix. Please carefully read the Migrate_qfe.txt file that is included in the Migration.exe file, which is included with the download.

Steps to Reproduce Behavior

To reproduce the memory leak, copy the following code and paste it into a Visual Basic project.

NOTE: Start the Performance Monitor and watch the Private Bytes counter for the process while running the code.

Please note that it does not make any difference what the field's Size property has been defined to be.


Sub TestRS()
Dim rs As New ADODB.Recordset
Dim str1 As String

str1 = String(8200, "a")
    
rs.Fields.Append "F1", adBSTR, 100
rs.Open

For i = 0 To 50
rs.AddNew
rs.Fields(0) = str1   '<--memory leak occurs here
rs.Update
Next

Set rs = Nothing
End Sub 

Additional query words: memory leak append createable recordset more than 16 K data conversion library oledb32.dll

Keywords : kbADO kbADO210fix kbGrpVBDB kbGrpMDAC kbDSupport kbMDAC250fix kbADO250
Version : WINDOWS:2.1,2.1 (GA),2.1 SP1,2.5
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: January 21, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.