thanks you!
I'm use redhat6.2,kernel 2.2.4, it occur error:
java.net.SocketException: Too many open files
Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process or per thread
The server has no file handles available
I try echo 8192 > /proc/sys/fs/file-max
but no effect. Then I change the limit of
limits.h and fs.h and recompile linux, but when
exceed about 1500 threads,it kill my whole program
and display error message:
at ChatServer.g.run(Unknown Source)
"Thread-866" (TID:0x40e5ef38, sys_thread_t:0x86e0310, state:CW) prio=5
at java.net.SocketInputStream.socketRead(Native
Method)
at java.net.SocketInputStream.read(SocketInputStream.java:86)
at java.
net.SocketInputStream.read(SocketInputStream.java:67)
|