Home > HowTo, Linux > socket:java.net.SocketException: Too many open files

socket:java.net.SocketException: Too many open files

August 19th, 2010 Leave a comment Go to comments

On our Glassfish enviroment we started seeing the following error:
socket:java.net.SocketException: Too many open files

Its caused by a limit on the OS. To find out your OS limit type:

# ulimit -n

To check how many open files a process may have find out its PID and type:

# lsof -p XXX | wc -l

The solution is:

# vim /etc/security/limits.conf

Add
* soft nofile 2048
* hard nofile 2048

(yes also the *)

Now restart sysctl:

# sysctl -p

Logoff and logon and check it now

#ulimit -a

Hope this helps.
Cheers,

Categories: HowTo, Linux Tags: , , , , , , , ,
  1. May 17th, 2012 at 01:31 | #1

    server connect please

  1. No trackbacks yet.

VAMOVE *

*