An exception occurred in the crawler's operation,
Java.net.SocketException:No buffer space available (maximum connections reached?): Jvm_bin
The httpclient is used in reptiles, and the thread pool is used.
Search the next found that other people have similar problems, the solution is as follows, according to change the program to see if the future operation will also appear this problem.
From http://9iopen.group.javaeye.com/group/blog/144545
The following exception was encountered in a crawler program:
Java.net.SocketException No buffer space available (maximum connections reached?): Jvm_bind
We know that the operating system has the maximum number of file handles that it allows to hold, while in the process of network connection, each socket request occupies a file handle resource, and if it is not released in time, it may deplete the file handle resource.
By examining the code, you find that when you send a GET request using httpclient, you do not release the resource, and because it is multithreaded, it is easy to run out of resources
The rewritten code is as follows: Java code httpclient client = New httpclient (); getmethod method = null; try { method = new getmethod (Crawlerurl.getuuri (). Getescapeduri ()); Statuscode = client.executemethod (method); /... } finally { if (null != method)  &N Bsp Method.releaseconnection (); }
One answer to the Sun's Technical forum is this:
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.
For more answers to this question, see here:
http://forum.java.sun.com/thread.jspa?threadID=556382