home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Neueste VersionenFixList
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Haben Sie Probleme? - Kontaktieren Sie uns.
Kostenlos registrieren anmeldung-x26
Kontaktformular kontakt-x26

DB2 - Problembeschreibung

Problem IC72564 Status: Geschlossen

MEMORY LEAK WHEN RUNNING CLI/ODBC APPLICATION THAT ALLOCATES AND FREES AN
ENVIRONMENT HANDLE FOR EVERY ITERATION IN THE PROCESS.

Produkt:
DB2 CONNECT / DB2CONNCT / 950 - DB2
Problembeschreibung:
A CLI / ODBC application can have a memory leak if the 
application makes the following series of calls in a loop: 
 
SQLAllocHandle (SQL_HANDLE_ENV) 
SQLAllocHandle (SQL_HANDLE_DBC) 
SQLConnect() 
SQLDisconnect() 
SQLFreeHandle (SQL_HANDLE_DBC) 
SQLFreeHandle (SQL_HANDLE_ENV) 
 
 
This can also occur if the application process spawns threads 
that perform those sequence of calls and multiple threads are 
invoked. 
 
This memory leak will only occur when the db2app.dll library is 
being unloaded and reloaded.  When using the DB2 CLI/ODBC driver 
with Microsoft's ODBC driver manager, the memory leak will occur 
since the ODBC driver unloads db2app.dll when SQLFreeHandle 
(SQL_HANDLE_ENV) is called.
Problem-Zusammenfassung:
**************************************************************** 
* USERS AFFECTED:                                              * 
* Windows                                                      * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* A CLI / ODBC application can have a memory leak if the       * 
* application makes the following series of calls in a loop:   * 
*                                                              * 
* SQLAllocHandle (SQL_HANDLE_ENV)                              * 
* SQLAllocHandle (SQL_HANDLE_DBC)                              * 
* SQLConnect()                                                 * 
* SQLDisconnect()                                              * 
* SQLFreeHandle (SQL_HANDLE_DBC)                               * 
* SQLFreeHandle (SQL_HANDLE_ENV)                               * 
*                                                              * 
*                                                              * 
* This can also occur if the application process spawns        * 
* threads that perform those sequence of calls and multiple    * 
* threads are invoked.                                         * 
*                                                              * 
* This memory leak will only occur when the db2app.dll library * 
* is being unloaded and reloaded.  When using the DB2 CLI/ODBC * 
* driver with Microsoft's ODBC driver manager, the memory leak * 
* will occur since the ODBC driver unloads db2app.dll when     * 
* SQLFreeHandle (SQL_HANDLE_ENV) is called.                    * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Version 9.5 Fixpack 8                         * 
****************************************************************
Local-Fix:
Instead of allocating a new environment handle for each 
iteration, just use one environment handle.  Then allocate a new 
connection handle for each iteration from that environment 
handle.  If using threads, allocate the environment handle in 
the main thread, and allocate the connection handles in the 
child thread.
verfügbare FixPacks:
DB2 Version 9.5 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 10 for Linux, UNIX, and Windows

Lösung
First fixed in DB2 UDB Version 9.5, Fixpack 8
Workaround
see Local Fix
Bug-Verfolgung
Vorgänger  : APAR is sysrouted TO one or more of the following: IC72649 IC72650 
Nachfolger : 
Weitere Daten
Datum - Problem gemeldet    :
Datum - Problem geschlossen :
Datum - der letzten Änderung:
12.11.2010
07.07.2011
07.07.2011
Problem behoben ab folgender Versionen (IBM BugInfos)
9.5.FP8
Problem behoben lt. FixList in der Version
9.5.0.8 FixList