Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 236574 - Last Review: October 7, 2005 - Revision: 2.4
FIX: Memory Leak When Field in Recordset Has More Than 16K of Data
This article was previously published under Q236574
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.
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.
A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Microsoft Data Access Components Service Pack 3 that contains this hotfix.
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 about support costs, visit the following Microsoft Web site:
NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
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
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem has been fixed in Microsoft Data Access Components version 2.5.
Manual Installation
- 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.
- Download the hotfix version of oledb32.dll into a temporary directory.
- Locate and rename the current version of oledb32.dll, which should be in the \Program Files\Common files\System\ole db folder.
- 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
APPLIES TO
- Microsoft OLE DB 2.1
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.1 Service Pack 2
- Microsoft Data Access Components 2.1 Service Pack 1
| kbhotfixserver kbqfe kbado210fix kbbug kbfix kbmdac250fix kbmdacnosweep kbqfe KB236574 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate