Consultor Eletrônico



Kbase P125915: 4GL Server Socket memory leak leads to error 9407
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/02/2008
Status: Unverified

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)

SYMPTOM(s):

4GL Server Socket memory leak leads to error 9407

Connecting to a Server Socket process many times can cause a memory leak.

Socket memory leak results in error 9407.

Connection failure for host <host> port <port> transport <transport_name>. (9407)

CAUSE:

There are two issues here. The first is that the server procedure is running out of file handles. This is caused by the second problem and is covered in solution P128866. See Below.

The second problem is that the server side socket is not being deleted when the connection ends. Subsequently when the server socket is repeatedly connected, new server socket objects are created, leading to a memory leak.

When a connection is made to a socket server procedure Progress implicitly creates a socket object. When the socket is no longer connected then it must be deleted, and this can be done in the connect procedure or read-response procedure.


FIX:

Delete the server socket object. If the deletion is to be done in the read-response procedure then the SELF system handle can be used to refer to the socket object.

For example, if the deletion is to be made in the Connect procedure, then use DELETE object:

procedure connProc:
def input parameter hSocket as handle. /* Socket implicitly created */
hSocket:disconnect().
DELETE OBJECT hSocket.
end.

If the deletion is to be made in the read-response procedure, then at the end of the read-response procedure use the CONNECT method and DELETE the object as follows:

IF NOT SELF:CONNECTED() THEN
DO:
SELF:DISCONNECT().
DELETE OBJECT SELF.
END.