Weblogic 11 Too many files openNormally any application server will require tuning and at times we tend to run with out of the box configuration and things run fine for a while. However when the load/traffic increase on the system the server would need to be tuned to scale otherwise you might see issue like the one mentioned below

"Too Many File Open" and the server stops responding causing an outage.


The following issue can be seen in the weblogic log files.

<Jul 15, 2009 9:14:55 AM
PDT> <Critical> <WebLogicServer> <BEA-000204>
<Failed to listen on port 7501, failure count: 1, failing for 0
seconds, java.net.SocketException: Too many open files>

15, 2009 9:14:56 AM PDT> <Notice> <WebLogicServer>
<BEA-000205> <After having failed to listen, the server is now
listening on port 7501.>

C Program to Test Upper Limit

The following C program can actual test how many file descriptors can be openned on the machine. Just copy it, compile it with gcc and run.

#include <stdlib.h>
#include <stdio.h>
#include <error.h>

int main(int argc, char* argv[]) {
    int iOpenFilesCnt = 0;
    while (1) {
        char szFileName[256];
        sprintf(szFileName, "my_file_%d.txt", iOpenFilesCnt);
        printf("Opening file name : %s, count is : %d", szFileName, iOpenFilesCnt);
        FILE* pFile = fopen(szFileName, "wb");
        if (pFile == NULL) {
            perror("Error opening file :");
            return 1;
        printf(" - donen");
        // do not close file descriptor !
    return 0;

Ulimit Command

You can also run the ulimit command from the terminal to find out what is the upper limit for the file handles that can be opened on the machine.

$ ulimit -a

time(seconds)        unlimited
file(blocks)          unlimited
data(kbytes)          unlimited
stack(kbytes)         10240
coredump(blocks)   unlimited
nofiles(descriptors) 8192
vmemory(kbytes)   unlimited


Review the output of the ulimit command and ask your System Administrator to increase values higher up to a limit that works best for your environment.