Microsoft KB Archive/153797

= FIX: Memory Leak with ODBC Driver Manager During Connect =

Article ID: 153797

Article Last Modified on 8/26/1999

-

APPLIES TO


 * Microsoft Open Database Connectivity 2.5

-



This article was previously published under Q153797





SYMPTOMS
When an ODBC application makes a certain sequence of calls to connect to an ODBC driver, a memory loss on the order of a few hundred bytes may occur due to a memory leak in the Driver Manager. The sequence that results in the memory leak is as follows: SQLAllocEnv SQLAllocConnect SQLConnect or SQLDriverConnect SQLDisconnect SQLFreeConnect SQLFreeEnv This leak affects only those applications that connect and disconnect frequently without ever exiting the application. For SQL Server replication users, this problem is encountered when a distribution server connects to subscription servers as an ODBC client.



WORKAROUND
An application can share connections. If an application needs to connect and disconnect frequently, you can shut down the application periodically. For example, if an application is running as a Windows NT service, you can periodically shut down and restart the service in order to clean up the memory leak. Under Windows NT and Windows 95, each application has its own memory address space. After the application is shut down, Windows NT and Windows 95 will clean up the application's memory space, including the memory leak.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Open Database Connectivity version 2.5.x. This problem has been corrected in Microsoft Open Database Connectivity version 3.0.x.

Additional query words: 2.50 ODBC DM VC++ VB C++ MSVC FoxPro

Keywords: kbbug kbfix KB153797

-

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

© Microsoft Corporation. All rights reserved.