Microsoft KB Archive/132493

= PRB: Memory Leaks with Desktop Database Drivers =

Article ID: 132493

Article Last Modified on 6/12/2001

-

APPLIES TO


 * Microsoft Open Database Connectivity 2.0

-



This article was previously published under Q132493



2.00

WINDOWS

kbinterop kbprb



SYMPTOMS
The following sequence of calls lead to a 4K memory leak in Microsoft Desktop Database Drivers version 3.x, 12K to 20K memory leak in 32-bit Microsoft Desktop Database Drivers version 2.x, and a 64K memory leak when 16-bit Microsoft Desktop Database Drivers are used:

SQLAllocEnv, SQLAllocConnect, SQLConnect (or SQLDriverConnect), SQLDisconnect, SQLFreeConnect, and SQLFreeEnv

NOTE: If you use an Access 3.x ODBC driver against an Access 2.x MDB file, the memory leak is between 12K and 20K. If you use the Access 3.x ODBC driver against an Access 7.x MDB file, the leak is 4K.



WORKAROUND
Share ODBC connections as much as possible in the application.



MORE INFORMATION
The 32-bit Microsoft Desktop Database Drivers include Microsoft Access, FoxPro, dBASE, Paradox, Microsoft Excel, and text drivers. The 16-bit Microsoft Desktop Database Drivers include Microsoft Access, Foxpro, dBASE, Paradox, Btrieve, Microsoft Excel, and text drivers.

All of the Desktop Database Drivers are implemented using the Microsoft Jet Database Engine. For 16-bit Desktop Database Drivers, ODBCJT16.DLL is the driver DLL file and MSAJT200.DLL is the 16-bit Jet Engine DLL file. Note that there is no memory leak in ODBCJT16.DLL during a connection or disconnection.

Steps to Check for 32-Bit ODBC Driver Memory Leaks
To determine memory leaks of the 32-bit ODBC driver, start the Process Viewer in the Windows NT Resource Kit. In addition, start the 32-bit ODBC Test application and to the following:  In Process Viewer, select ODBCTE32. Click Refresh and note the "Heap Usage" number. In the 32-bit ODBC Test application, do the following:

 From the Connect menu, select SQLAllocEnv. From the Connect menu, select SQLAllocConnect. From the Connect menu, select SQLConnect. Connect to any Microsoft desktop data source. You may also select SQLDriverConnect, instead of SQLConnect. From the Connect menu, select SQLDisconnect, SQLFreeConnect, and SQLFreeEnv.</li></ol> </li> In Process Viewer, click Refresh. Note the "Heap Usage" number again.</li></ol>

Process Viewer now displays memory leaks in the Desktop Database Drivers.

Additional query words: 2.00.2317 sql 6.00 windows nt pviewer

Keywords: KB132493

-

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

© Microsoft Corporation. All rights reserved.