PreviousNextUpFAQ Table of Contents

FreeBSD 2.2.6-RELEASE

JDK for FreeBSD

You should run the latest Java virtual machine for FreeBSD, available from:

Make sure to use JDK 1.1.6, dated 14 August 1998 or later, since earlier versions had a bug in the socket timeout feature of Java. Look for a file named something like:

jdk1.1.6.V98-8-14.tar.gz

You can verify your installation by typing "java -fullversion" from the command line. You should see a version with the following date or later:

java_X full version "jdk1.1.6-FreeBSD:1998/08/14"

File descriptors

For FreeBSD, the limit on the number of open files is determined with the following formula:

system wide open files limit = 2 * [20 + (16 * maxusers)]

where maxusers is defined in your kernel configuration file and has a default of 10. So by default, your entire system is limited to 360 open files and network socket connections:

2 * [20 + (16 * 10)] = 360 open files and sockets

The limit on the number of open files per process is the same as this system wide limit. Since you need one file descriptor for each concurrent connection to the VolanoChat server, you may need to increase this number to handle hundreds of simultaneous chat connections. If the VolanoChat server hits the descriptor limit, you'll see messages in the error log stating:

java.net.SocketException: Too many open files in system

You can increase the limits without rebooting by entering the commands shown below as root.

blue# sysctl -w kern.maxfiles=4096
kern.maxfiles: 360 -> 4096
blue# sysctl -w kern.maxfilesperproc=4096
kern.maxfilesperproc: 360 -> 4096

For a permanent change, add the following two lines to the script /etc/rc.local.

sysctl -w kern.maxfiles=4096
sysctl -w kern.maxfilesperproc=4096

Alternatively, you can increase the value of maxusers in your kernel configuration file from its default of 10 to a higher number, such as 100. It is not recommended to increase this number beyond 256, though. See the file /usr/src/sys/i386/conf/LINT for more information.


PreviousNextUpFAQ Check HTML Table of Contents