DB2 - Problem description
Problem IC91220 | Status: Closed |
MEMORY LEAK IN UCA500R1 COLLATION DATABASE WHEN USING COLUMN NAME IN pattern-expression of LIKE clause | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
This memory leak is specific to using a UCA500R1 collation sequence database in conjunction with a LIKE predicate that uses column name in pattern expression. Example of the syntax: LIKE(MyCol || '%'). This type of LIKE pattern expression is supported since version 9.7 Fixpack 4. You can identify the leak in PRIVATE memory using the db2pd tool : DB2SYSC=`db2pd -edu | grep "db2sysc PID:" | awk '{ print $3}'` db2pd -dbptnmem > dbptnmem.1.out db2pd -memb pid=$DB2SYSC > memb.1.out db2 "select * from MySchema.MyTable WHERE COALESCE(MyCol_1,'') LIKE (MyCol_2 || '%')" db2pd -dbptnmem > dbptnmem.2.out db2pd -memb pid=$DB2SYSC > memb.2.out After the running the statement, the size of PRIVATE MEMORY will show an increase in PRIVATE memory that could be consequent depending on the result set (you can compare the 2 output files generated as above : dbptnmem.*.out) : === BEFORE EXECUTION === Database Partition Memory Controller Statistics Controller Automatic: N Memory Limit: 4000000 KB Current usage: 341376 KB HWM usage: 341376 KB Cached memory: 175296 KB Individual Memory Consumers: Name Mem Used (KB) HWM Used (KB) Cached (KB) ======================================================== APPL-FOD 160000 160000 158848 DBMS-dbguest0 48448 48448 0 FMP_RESOURCES 22528 22528 0 PRIVATE 9344 9344 0 LCL-p21517 128 128 0 DB-FOD 100928 100928 16448 === AFTER EXECUTION === Database Partition Memory Controller Statistics Controller Automatic: N Memory Limit: 4000000 KB Current usage: 2590208 KB HWM usage: 2595200 KB Cached memory: 175296 KB Individual Memory Consumers: Name Mem Used (KB) HWM Used (KB) Cached (KB) ======================================================== APPL-FOD 160000 160000 158848 DBMS-dbguest0 48384 48384 0 FMP_RESOURCES 22528 22528 0 PRIVATE 2258240 2258240 0 LCL-p20550 128 128 0 DB-FOD 100928 100928 16448 This memory leak can lead to a SEGV in sqlvCCCBuildNextLikeRule or sqlnlsStringSearch_open_ICUbug_U500R1 if the leak grows over INSTANCE_MEMORY. In such case the trap will show a stack similar to this one : PC location: __1cYsqlvCCCBuildNextLikeRule6FpnIsqlrr_cb_pknOsqlrxCollation_pp nPsqlvCCCLikeRule_6pCi8iipi_i_ + 0x11a8 Object file: /opt/IBM/db2/V9.7B/lib64/libdb2e.so.1 (offset 0x4a11f48) </Registers> <StackTrace> ##### Object: /opt/IBM/db2/V9.7B/lib64/libdb2e.so.1 __1cYsqlvCCCBuildNextLikeRule6FpnIsqlrr_cb_pknOsqlrxCollation_pp nPsqlvCCCLikeRule_6pCi8iipi_i_(0xffffffff8b0f0001,0xffffffff6229 6d18,0x18b00000,0xb6c00,0xfffffffccd7f59f0,0x870f0000) + 0x11a8 __1cbCsqlriCCCLikeComputeRulesCore6FpnIsqlrr_cb_pnKsqlz_value_3p nUsqlriCCCLikeWorkArea__i_(0xffffffff4beccba0,0x2,0x0,0xffffffff 633b2728,0x0,0x1) + 0xa8c __1cYsqlriCCCLikeComputeRules6FpnIsqlrr_cb__i_(0xffffffff4beccba 0,0x0,0x276823c,0x2,0xc8000,0xffffffff7c85a2c0) + 0x58 __1cQsqldEvalDataPred6FpnNSQdDLD_DFM_WORK_pLpnKSQdDLD_DPRED__i_( 0xffffffff63ee3710,0xfffffffccd7f6008,0xffffffff633b26b8,0x1788, 0xffffffff633b2cd0,0xf808600220800) + 0x140 __1cMsqldReadNorm6FpnNSQdDLD_DFM_WORK_l_i_(0xffffffff63ee3710,0x 1e,0x6,0xffffffff63ee3888,0x1,0x0) + 0x1734 __1cPsqldFetchDirect6FpnNSQdDLD_DFM_WORK__i_(0xffffffff63ee3710, 0x0,0xffffffff63ee3788,0xffffffff63ee38d8,0x0,0xffffffff63ee3888 ) + 0x4740 __1cHsqldfrd6FpnNSQdDLD_DFM_WORK__i_(0xffffffff63ee3710,0x205800 1f,0xf808600220800,0xfffffffec316c000,0x0,0x1f) + 0x1040 __1cMsqldRowFetch6FpnIsqeAgent_pnISQdDLD_CCB_LLppnKSQdDLD_VALUE_ pnISQdDLZ_RID_LpnMSQdDLD_ID_LIST_pnJSQdDLP_LSN8__i_(0x8,0xffffff ff7c85a2c0,0xffffffff63ee3710,0xfffe,0x0,0xffffffff633b21f0) + 0x1f84 | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Database with UCA500R1 collation sequence * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description. * * * * You will notice as well a large number of memory blocks * * allocated for "sqlnlsICUcallback.C (LOC 112)" after * * running * * the statement by using the following command on the * * generated * * file above. * * * * $ grep sqlnlsICUcallback.C memb.2.out | wc -l * **************************************************************** * RECOMMENDATION: * * Upgrade to version 9.7 Fix Pack 9 * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows | |
Solution | |
First fix in version 9.7 Fix Pack 9 | |
Workaround | |
not known / see Local fix | |
BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC91803 IC97525 follow-up : | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 02.04.2013 16.12.2013 16.12.2013 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.FP9 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.9 | |
9.7.0.9 |