My Oracle Support Banner

Socket/FileDescriptor Leak When Executing WLS Application To A Blocked Port Using Weglogic HTTPClient Package (Doc ID 2238406.1)

Last updated on DECEMBER 16, 2023

Applies to:

Oracle WebLogic Server - Version and later
Information in this document applies to any platform.


On WebLogic Server version, you observe file descriptor leak when using  HttpURLConnection. This is when a client program running in WebLogic space tries to submit an URL to a remote server. 

In the scenario issue can be reproduced to cause a file descriptor leak on linux - when method throws exception because of a network problem that make the remote server unreachable, specifically when not able to complete most basic tcp/ip handshake sequence with the  next network device which is supposed to handle the connection.

Issue reproduced if you try to connect to a remote server that is blocked by a firewall. Firewall drops initial SYN packet received from the client. This makes the connection hang in SYN_SENT state for a while, the socked is eventually cleaned up (not reported in netstat anymore), but the original file descriptor associated to the socket gets stuck forever associated to the process or jvm.

After 2 seconds (CONNECT_TIMEOUT) of waiting for connection you will notice the following exception:

In order to identify the presence of file descriptor leaks, monitor the WebLogic process using netstat and lsof.


java PID oracle 440u IPv6 36032994 TCP mymachine:PORT1-> (SYN_SENT)
* notice the 440u file descriptor in previous line

After a some minutes the socket is not listed (SYN_SENT) anymore, but querying the file descriptor(FD) 440 it remains there forever until the process is stopped.

Lsof (after several minutes or hours):
java PID oracle 440u sock 0,5 36032994 can't identify protocol      <---- this is the leak


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.