IBM Support

DB2 JCC Exception -4499 : No buffer space available (maximum connections reached?)

Troubleshooting


Problem

Users may receive the following JCC error on Windows platform: FATAL notify - Exception in SQLState -->08001 Message --> [jcc][t4][2043][11550][3.57.82] Exception java.net.SocketException: Error opening socket to server /xxx.xx.xx.xx on port 50,000 with message: No buffer space available (maximum connections reached?): connect. ERRORCODE=-4499, SQLSTATE=08001 ErrorCode --> -4499

Symptom

JCC exception with error :

Message --> [jcc][t4][2043][11550][3.57.82] Exception java.net.SocketException: Error opening socket to server /xxx.xx.xx.xx on port 50,000 with message: No buffer space available (maximum connections reached?): connect. ERRORCODE=-4499, SQLSTATE=08001
ErrorCode --> -4499

Cause


This error can be caused by a few reasons, below are the causes and fixes:

Cause 1. User may have encountered the windows socket leak bug.

Cause 2. Physical limitation, user may not have sufficient system resources.

Cause 3. Windows configuration, user may need to increase the ephemeral (short-lived) TCP ports numbers on Windows.

Cause 4. Application opens too many physical connections to the database and ended up reaching the max connection limit on db2. This can be verified by one of the following methods :

a. checking "netstat -an" output by checking the number of established connections, you may see a large number of established connections and output similar to the following:
TCP    172.16.81.70:50000     PHRTMMINA:63433        ESTABLISHED
 TCP    172.16.81.70:50000     PHRTMMINA:63434        ESTABLISHED
 TCP    172.16.81.70:50000     PHRTMM

This shows the connections are reaching the limitation of 65534.

b. checking "db2pd get snapshot for dbm" output, in this output you need to look for the following variables:
High water mark for agents registered          = 30455
Agents registered                      = 17071
Idle agents                       = 0

this example shows that the peak number of agents connected to DB2 is 30455, which is abnormally high.

These are the indicators that the application users use is opening too many connections and reaching the max connection limitation.

Diagnosing The Problem

Checking all causes listed above will help diagnose the exact problem.

Resolving The Problem


Following are the fixes corresponding to the causes above :

Fix 1. User needs to apply Microsoft hotfix from http://support.microsoft.com/kb/2577795

Fix 2. Check user's system and expand system resources required, for example, memory.

Fix 3.
a. Open "Registry Editor" with administrator privilege
b. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
c. Add a variable name "MaxUserPort" type REG_DWORD and set its value to 65534 base decimal.

Fix 4. We cannot fix this, the fix is with the application. User will have to modify their application so that it does not open that many connections to DB2, or, to reuse the connections.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Database Objects\/Config - Bufferpools","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21690707