Re: maximum number of open files (493 Views)
Reply
Advisor
Mridul Dutta
Posts: 59
Registered: ‎12-07-2005
Message 1 of 9 (794 Views)
Accepted Solution

maximum number of open files

Hi friends ,

i m getting an error in "/var/adm/messages" file

syslog: Java: Number of open files: 4096
syslog: Java: Maximum number of allowed open files: 4096
syslog: Java: Number of open files: 4096
syslog: Java: Maximum number of allowed open files: 4096

Please give me some hints regarding the above error messages.

Regards

Mridul Dutta
Please use plain text.
Honored Contributor
Mridul Shrivastava
Posts: 980
Registered: ‎01-30-2006
Message 2 of 9 (794 Views)

Re: maximum number of open files

max no. of open files is limited bi Kernel Parameter nfile.

But this can not be changed dynamically and other parameters value also gets affected. To overcome these error messages we have to increase its value after consulting from application team.

Based on your OS version this change may require a reboot.
Time has a wonderful way of weeding out the trivial
Please use plain text.
Honored Contributor
Mridul Shrivastava
Posts: 980
Registered: ‎01-30-2006
Message 3 of 9 (794 Views)

Re: maximum number of open files

max no. of open files is limited by Kernel Parameter nfile.

But this can not be changed dynamically and other parameters value also gets affected. To overcome these error messages we have to increase its value after consulting from application team.

Based on your OS version this change may require a reboot.
Time has a wonderful way of weeding out the trivial
Please use plain text.
Honored Contributor
whiteknight
Posts: 1,501
Registered: ‎11-22-1999
Message 4 of 9 (794 Views)

Re: maximum number of open files


Mridul,

kmtune -q max_files

example:-
# kmtune -q maxfiles
Parameter Current Dyn Planned Module Version
===============================================================================
maxfiles 60 - 60

=> Tune maxfiles kernel parameter > 4096

WK
Problem never ends, you must know how to fix it
Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,205
Registered: ‎05-29-2000
Message 5 of 9 (794 Views)

Re: maximum number of open files

There are three parameters: nfile, maxfiles and maxfiles_lim. Here is how they work:

nfile = maximum number of files (and network sockets) opened at the same time.

maxfiles = maximum number of files that can be opened by a single process. This is a soft limit and may be extended by the process itself with a call to setrlimit() or by changing the ulimit value prior to starting the process.

maxfiles_lim = maximum number of files that can ever be opened at the same time by a single process. This is a hard limit and can only be changed by changing the kernel value. If you are running 11.11 or later, you can change this value without a reboot.

Now 4096 is a large number of files, so the first question is whether the code is working correctly. If so, then change the kernel parameter maxfiles_lim to 8192 or 16384, whatever is needed. And if your Java code was not written to dynamically change maxfiles using setrlimit, then make maxfiles = maxfiles_lim.
Please use plain text.
Visitor
PavanAgrawal
Posts: 3
Registered: ‎05-17-2013
Message 6 of 9 (507 Views)

Re: maximum number of open files

Hello

 

I am facing the same problem in our system where  below error was coming

May 14 19:23:14 cmd1 syslog: Java: Maximum number of allowed open files: 4096

at that time maxfiles_lim value was 4096 than we changed it to 16384 but still problem not resolved , java process is still not able to take new value and still same error is coming , below is the output after change

 

bash-4.2# kctune | grep maxfiles
maxfiles                                2048  Default
maxfiles_lim                           16384  16384       Immed
bash-4.2# kcusage | grep maxfiles
maxfiles_lim             4096 / 16384
bash-4.2#

 

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,971
Registered: ‎03-06-2006
Message 7 of 9 (502 Views)

Re: maximum number of open files

>maxfiles_lim value was 4096 than we changed it to 16384 but still problem

 

Have you logged out?  What does this show?

$ /usr/bin/ulimit -Hn;  /usr/bin/ulimit -Sn

Please use plain text.
Visitor
PavanAgrawal
Posts: 3
Registered: ‎05-17-2013
Message 8 of 9 (498 Views)

Re: maximum number of open files

bash-4.2# /usr/bin/ulimit -Hn
16384
bash-4.2# /usr/bin/ulimit -Sn
2048

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,971
Registered: ‎03-06-2006
Message 9 of 9 (493 Views)

Re: maximum number of open files

>/usr/bin/ulimit -Sn => 2048

 

Hmm, the strange thing is that you don't get this in your error message.

You need to set the soft limit larger before you run your app.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation