IBM Support

DB2 Text Search が IQQG0020E java.lang.OutOfMemoryError: Java heap space にて動かない

Question & Answer


Question

DB2 Text Search が IQQG0020E java.lang.OutOfMemoryError: Java heap space にて動かないときの回避策はありますか。

Answer

DB2 Text Search を起動 "db2ts START FOR TEXT", すると db2diag.log に以下の CIE00760 、ログファイル db2tss/log/default0.log に OutOfMemoryError が記載され動かないことがあります。
---------------------
2015-04-23-13.01.09.364000+540 I72992120F587        LEVEL: Severe
PID     : 1172                 TID : 2656           PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000           DB   : SAMPLE
APPHDL  : 0-2761               APPID: 192.168.0.0.xxxx
AUTHID  : DB2INST1             HOSTNAME: MYHOST1
EDUID   : 2656                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, Text Search, CieError::makeDiagnosticMessage, probe:1
MESSAGE : CIE reason
DATA #1 : Hexdump, 4 bytes
0x0000009D499A71B8 : F802 0000                                  ....
2015-04-23-13.01.09.380000+540 I72992709F565        LEVEL: Severe
PID     : 1172                 TID : 2656           PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000           DB   : SAMPLE
APPHDL  : 0-2761               APPID: 19.168.0.0.xxxx
AUTHID  : DB2INST1             HOSTNAME: MYHOST1
EDUID   : 2656                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, trace services, sqlt_logerr_string (secondary logging function), probe:30
MESSAGE : Message
DATA #1 : String, 29 bytes
CIE00760 .v...g.R...E.G...[.B
2015-04-23-13.01.09.427000+540 I72993276F708        LEVEL: Warning
PID     : 1172                 TID : 2656           PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000           DB   : SAMPLE
APPHDL  : 0-2761               APPID: 192.168.0.0.xxxx
AUTHID  : DB2INST1             HOSTNAME: MYHOST1
EDUID   : 2656                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, oper system services, sqloInvokeInterruptible, probe:15
DATA #1 : String, 208 bytes
An unfenced User Defined Function (UDF) was abnormally terminated.
This may leave the DB2 engine in inconsistent state.
It is recommended that DB2 server instance is stopped and restarted as soon as possible.
2015-04-23-13.01.09.458000+540 I72993986F592        LEVEL: Error
PID     : 1172                 TID : 2656           PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000           DB   : SAMPLE
APPHDL  : 0-2761               APPID: 192.168.0.0.xxxx
AUTHID  : DB2INST1             HOSTNAME: MYHOST1
EDUID   : 2656                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, runtime interpreter, sqlri_tfcls, probe:191
RETCODE : ZRC=0xFFFFFE52=-430
          SQL0430N  User defined function "" (specific name "") has abnormally
          terminated.
---------------------
ファイル db2tss/log/default0.log からの抜粋
---------------------
<record>
    <date>2015-04-23T13:01:09</date>
    <millis>1429761669239</millis>
        :
    <message>Throwable while running listener: IQQG0020E java.lang.OutOfMemoryError: Java heap space
        :
</record>
---------------------
ファイル db2tss/log/serverConfiguration.log からの抜粋
---------------------
    maxHeapSize = 1500M
---------------------
以下ような grep コマンドなどで OutOfMemoryError が起こった日付を db2tss/log 下の monitorX.csv から特定します。
$ grep -l '2015-04-23' monitor*
monitor0.csv <<-- この例では monitor0.csv に2015-04-23日のデータが書かれています。
ファイル monitorX.csv は以下のような書式で、17番目のカラムは Used Heap Memory (MB) をあらわしています。
---------------------
Time(sec),
Total number of processed documents,
Total size of processed documents (KB),
Total number of add requests that failed,
Total number of successful add requests,
Total size of successful add requests (KB),
Total number of delete requests that failed,
Total number of successful delete requests,
Documents in the input queue,
Input queue size (in bytes),
Documents in the output queue,
Output queue size (in bytes),
Documents waiting for preprocessing,
Documents currently in preprocessing,
Documents waiting for indexing,
Documents currently being indexed,
Used Heap Memory (MB),
Thread Count,
System Load,
Open File Descriptors,
Free Physical Memory,
Batches,
activeMerges,
mergesSizeMB
---------------------
以下のコマンドにて2015-04-23日のなかの5つのピーク時のUsed Heap Memory (MB)を調べます。
$ grep '2015-04-23' monitor0.csv | awk -F',' '{print $17}' | uniq | sort -rn | head -5
1493
1492
1492
1491
1488
上記から 1493MB が得られ、この値はserverConfiguration.logで設定されているmaxHeapSize = 1500Mとほぼ同量なのでIQQG0020E java.lang.OutOfMemoryError はこの上限値にヒットしたと推測できます。
この上限値による現象なのか否かを確認するために maxHeapSize を2倍、あるいは3倍に設定して再度起動を試みます。起動ができたときの日付を確認し、以下ような grep コマンドなどで日付を db2tss/log 下の monitorX.csv から特定します。
$ grep -l '2015-04-25' monitor*
monitor3.csv <<-- この例では monitor3.csv に2015-04-25日のデータが書かれています。
以下のコマンドにて2015-04-25日のなかの5つのピーク時のUsed Heap Memory (MB)を調べます。
$ grep '2015-04-25' monitor3.csv | awk -F',' '{print $17}' | uniq | sort -rn | head -5
2714
2527
2526
2525
2524
上記のようにこのシステムは 2714 MB が必要でしたが 2015-04-23 には 1500 MB しか利用できなかったので問題が発生していたことが確認できます。このシステムの場合には maxHeapSize を 3000MB にすることで問題を回避することができます。以下は 3000M を設定する実行例です、こちらの実行前に db2ts "stop for text" の実行が必要です。
$ configTool set -system -maxHeapSize 3000M -configPath /home/db2inst1/sqllib/db2tss/config

残念ながら、maxHeapSize はINDEXの数とそのサイズに依存するので事前に適切な値をを導く計算式はございません。OutOfMemoryエラーを防ぐためには定期的にmonitorX.cvfファイルを精査し設定している値とピーク値を確認することで可能です。
注:
このテックノートにて問題の特定ができなかった場合にはサービス契約のもと IBM サービス・ラインにお問い合わせください。
  ファイル monitorX.csv はIBMの内部ファイルでそのフォーマットは予告無く変更されることがあります。
フォーマットが変更された場合にはお客様自身にて修正を加えるかあるいは上述の記述は適応できませんのでご了承ください。
この挙動は将来断り無く変更されることがあります。このテックノートの内容が有効か否かは上記の手順を実行することにより確認できます。

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PlsAAE","label":"Extenders-\u003EText Search"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"All Version(s)","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
07 December 2022

UID

swg21903610