Friday, April 4, 2014

Too Many Open Files Exception while running application on Unix

While working on client side and running Webcenter portal application on the Unix System, we saw exception stating : error = 24 , Too Many Open Files.

Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 40 more



This error comes because there in UNIX systems, each socket connection to WebLogic Server consumes a file descriptor. File descriptor paramater specifies the number of concurrent files which can be opened per process.

Since this exception is coming, the maximum limit of file descriptor is not sufficient. So we need to increase the value of File Descriptor.

This can be done by increasing the ulimit on Unix System.

This is done as following:

$ ulimit -H -n                             (Display hard limit, cannot be exceeded)
$ ulimit -S -n                             (Display soft limit may be increased up to hard limit value)
$ ulimit -S -n 3500                   (Increase the soft limit to 4096)


You can configure WebLogic specific number fromWEBLOGIC_HOME/common/bin/commEnv.sh script (note that this script is used on each domain created, if you want the domain specific limits you can use DOMAIN_HOME/bin/setDomainEnv.sh). 

3 comments:

  1. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    digital marketing course in Chennai | digital marketing training in Chennai

    ReplyDelete
  2. BlueHost is ultimately one of the best website hosting company with plans for any hosting needs.

    ReplyDelete