Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

TCP/IP socket reading trouble - help- please

Thread view: 
daniel.shaya@tamesis.com - 30 Jun 2005 13:59 GMT
I have a distributed java (jdk1.4) system running on a Windows 2003
enterprise server (4 cpu 8GB RAM).

There are about 17 servers communicating through JMS (using SWIFT) and
direct socket connections.

After a while servers begin to throw the following exception.

java.net.SocketException: No buffer space available (maximum
connections reached?): recv failed
at java.net.SocketInputStream.socketRead0 (Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
at sun.nio.cs.StreamDecoder.read0 (StreamDecoder.java:131)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:117)
at java.io.InputStreamReader.read(InputStreamReader.java:151)

Any help at all greatly appreciated.

Daniel
iksrazal@terra.com.br - 30 Jun 2005 15:10 GMT
> I have a distributed java (jdk1.4) system running on a Windows 2003
> enterprise server (4 cpu 8GB RAM).
[quoted text clipped - 6 lines]
> java.net.SocketException: No buffer space available (maximum
> connections reached?): recv failed

Did you do what I recommended last week or so? There can be issues with
socket cleanup and Java, and while you may only have a few sockets
running, it can snowball. Since JMS is implemented per vendor, hard to
say. Showing from a TCP point of view what is happening could explain
alot - or eliminate some possibilities.

In short, run netstat and post your filtered results.

HTH,
iksrazal
http://www.braziloutsource.com/
daniel.shaya@tamesis.com - 30 Jun 2005 15:33 GMT
Yes I tried this.

We are definitely not running out of sockets.

I'm afraid it's something else.
iksrazal@terra.com.br - 30 Jun 2005 17:40 GMT
> Yes I tried this.
>
> We are definitely not running out of sockets.
>
> I'm afraid it's something else.

There is a difference between having say 15 sockets open but not
closing them properly and ending up with a 1000. Anyways, still seems
like a resource issue - that is always the case with this exception.
You could try using a bigger bucket at the OS level. In Windows there
is a "MaxConnections" registry key. Note this just makes the bucket
bigger and may just overflow again. I'm afraid you'll have to do some
testing at the OS level to understand just what resource Java seems to
be lacking. Something should be obvious.

HTH,
iksrazal
http://www.braziloutsource.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.