The possibility analysis of java.net.SocketException anomaly

Source: Internet
Author: User
Tags ming stub system log

The possibility analysis of java.net.SocketException anomaly

Recently in an MQ project, when deployed, after running every two or three days down the machine once, the software died. Through System log Analysis:

InforSuiteV6.0.0 Build2009042101 started

2010-3-29 15:58:36 clientcommunicatoradmin Restart

Warning: Failed to restart:java.io.IOException:Failed to get a RMI stub:javax.na

Ming.communicationexception [Root exception is Java.rmi.ConnectIOException:Exce

Ption Creating connection to:127.0.0.1; Nested exception is:

Java.net.SocketException:No buffer space available (maximum connections

Reached?): Jvm_bind]

2010-3-29 15:58:36 Rmiconnector Rmiclientcommunicatoradmin-dostop

Warning: Failed to call the method close (): Java.rmi.ConnectIOException:Exception C

reating connection to:10.0.0.2; Nested exception is:

Java.net.SocketException:No buffer space available (maximum connections

Reached?): Jvm_bind

2010-3-29 15:58:36 clientcommunicatoradmin Checker-run

Warning: Failed to check connection:java.net.SocketException:No buffer spaces Avai

Lable (maximum connections reached?): Jvm_bind

2010-3-29 15:58:36 clientcommunicatoradmin Checker-run

Warning: Stopping

2010-3-29 15:58:52 clientcommunicatoradmin Restart

Warning: Failed to restart:java.io.IOException:Failed to get a RMI stub:javax.na

Ming.communicationexception [Root exception is Java.rmi.ConnectIOException:Exce

Ption Creating connection to:127.0.0.1; Nested exception is:

Java.net.SocketException:No buffer space available (maximum connections

Reached?): Jvm_bind]

It was found that some socket exceptions were thrown, which were caused by the use of the file handle. In other words, the open socket inside the program, did not shut down in time. In order to further seek technical support, verify that the analysis is reasonable and find Sun's website information:

Chances are you are forgetting to close a socket, a database connection, or some other connection this uses sockets Ally. Example program below.
The alternative is this your program (or the sum of all programs running on your computer) really needs a lot of connectio Ns. In this case you'll need to the increase the amount of socket buffer spaces that your operating system allocate S. I ' d start by Googling for instructions. Or Maybe you could redesign your program so, that it doesn ' t is very much.

Sun's technical support confirms the justification for the previous analysis. Java.net.SocketException exception and socket is not closed, the operating system has the maximum number of file handles it allows to hold, while in the process of network connection, each socket request occupies a file handle resource, if not released in time, The file handle resource may be exhausted.

Therefore, in time to close those no longer use the socket, can reasonably solve the thrown java.net.SocketException exception.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.