Error 'java.net.SocketException Too many open files' when I run a Java application that uses TCP sockets?

Solution Verified - Updated -

Issue

  • Error 'java.net.SocketException: Too many open files' when I run a Java application that uses TCP sockets?
  • We are getting a too many open files exception on the Jboss EAP server. The below is the entries that we have on sysctl file:
[root@user123 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key.

Also, when we observe the number of open files based on the process id for JBOSS EAP, it is 1082.
Let us know if any more inputs are needed to resolve this issue.

error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.forwarding = 0
error: permission denied on key 'net.ipv4.conf.all.mc_forwarding'
net.ipv4.conf.default.log_martians = 1
net.ipv4.conf.all.log_martians = 1
net.ipv4.tcp_max_syn_backlog = 4096

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 4.2.x
    • 4.3.x
    • 5.x
    • 6.x
  • Linux/Solaris

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.