Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SocketException: No buffer space available (maximum connections reached)

843790May 29 2006 — edited Aug 3 2009
Hi</br></br>
<b>I am currently doing some load testing of a NIO TCP/IP based Server:</b></br>
- Server and Client on same machine.</br>
- PC: P4, 3GHz, 1GB RAM, Windows XP, SP2</br></br>
I seem to always reach a limit on the number of connections to the Server (not sending any messages), i.e. using a single client making multiple connection requests, after a few 1000 connections (Task Manager: 130k Handles), I get the following exception:</br>
...</br>
java.io.IOException: Failed to get the session.</br>
at ....</br>
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect</br>
at sun.nio.ch.Net.connect(Native Method)</br>
.....</br></br>
<b>I have tried the following, (with little or no success): </b></br>
- Changing some of the registry settings, e.g. TCPNumConnections, MaxUserPort. (No effect)</br>
- Using Heap buffers (No effect)</br>
- Using the compiler options (CPU usage went from 100% to 75%): -Xmn 100M -Xms -500M -Xmx 500M</br></br>

Will using a non-NIO Client help?</br></br>

Is this problem Win XP O.S. specific. Does Win XP place a limit on the number of:</br>
- Simultaneous TCP connections</br>
- File Handles/Descriptors</br>
- Socket buffer size</br></br>

If the problem is O.S. related:</br>
- Can any of the above parameters be changed, e.g. Registry settings</br>
- What would the best OS for a Server, e.g. Windows Server 2000/2003, or Linux (which version: Redhat, Fedora, Debian)?</br></br>

Does PC's processor speed/RAM have any effect, i.e. will 300MHz, 128 MB be as good as 1GHz, 1GB RAM?</br></br>

Many Thanks,</br>
Matt</br>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2009
Added on May 29 2006
3 comments
919 views