Operating System - HP-UX
1745874 Members
4381 Online
108723 Solutions
New Discussion юеВ

maximum number of open files

 
SOLVED
Go to solution
Mridul Dutta
Advisor

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
8 REPLIES 8
Mridul Shrivastava
Honored Contributor
Solution

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
Mridul Shrivastava
Honored Contributor

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
whiteknight
Honored Contributor

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
Bill Hassell
Honored Contributor

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.


Bill Hassell, sysadmin
PavanAgrawal
Visitor

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#

 

Dennis Handly
Acclaimed Contributor

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

PavanAgrawal
Visitor

Re: maximum number of open files

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

Dennis Handly
Acclaimed Contributor

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.