Operating System - HP-UX
1836620 Members
1921 Online
110102 Solutions
New Discussion

Re: U_STACK_TRACE: Too many open files

 
SOLVED
Go to solution
Remy_1
Occasional Advisor

U_STACK_TRACE: Too many open files

Hi,
While running some cobol/app engine programs and I'm getting the following error: U_STACK_TRACE: Too many open files
I've checked my kernel and these are the values of what I think it's files related:
maxfiles=60
maxfiles_lim=1042
nfiles=7142
Could one of these being set too low?
Please help!

Thanks,
Remy
7 REPLIES 7
Sridhar Bhaskarla
Honored Contributor
Solution

Re: U_STACK_TRACE: Too many open files

Hi Remy,

You can check out nfile usage by

sar -v 2 20

Look at the last column that says file-sz. If the nominator (usage) is close to denominator (limit), then you will need to consider increasing that value. nfile is the total number of files you can open on the system.

If the above is not true, then there is a good chance that maxfiles and|or maxfiles_lim have overflown. maxfiles is softlimit and it can be changed upto maxfiles_lim . These are per process limits.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Remy_1
Occasional Advisor

Re: U_STACK_TRACE: Too many open files

Hi,

Thanks for the fast reply.
I'm getting this for the command you recommended:
16:52:59 N/A N/A 433/4116 0 2136/4540 0 3544/7422 0
and it looks like i'm only using half of the total.
Could it be something else?

Thanks again,
Remy
A. Clay Stephenson
Acclaimed Contributor

Re: U_STACK_TRACE: Too many open files

"Too many open files" refers to EMFILE or errno 24. This is the per process maximum number of open file descriptors (maxfiles) as opposed to the system-wide number of files (nfiles). Increase maxfiles and your problems should be over unless you hard hit the hard limit (maxfiles_lim) , in which case, maxfiles_lim would also need increasing.

If it ain't broke, I can fix that.
Remy_1
Occasional Advisor

Re: U_STACK_TRACE: Too many open files

Thank you all your help. I think my maxfiles and maxfiles_lim has to be increase.
Is there a limit I should stay within or can I just make up a high number to avoid this from happening again?

Thanks again,
Remy
Sridhar Bhaskarla
Honored Contributor

Re: U_STACK_TRACE: Too many open files

Hi Remy,

Then as I mentioned in the next paragraph, maxfiles (or maxfiles_lim if you are already setting your maxfiles to match maxfiles_lim). If you haven't done anything do the following.

$sh
$ulimit -a

(look at nofiles value)
$ulimit -n 1042
$ulimit -a
(verify nofiles value)

If you start the processes from this shell, all the child processes will have 1042 limit. You can put it in your .profile so that everytime you login, you will get the new value.

If this is not enough, increase the kernel parameters. Set maxfiles to 1024 and maxfiles_lim to 2048 though SAM. You will need to reboot the box.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Remy_1
Occasional Advisor

Re: U_STACK_TRACE: Too many open files

Hi,

Do I have to do it for all users or can I do it for root and it will export out to all users?

Thanks again,
Remy
Sridhar Bhaskarla
Honored Contributor

Re: U_STACK_TRACE: Too many open files

Hi Remy,

It's for the user that is running the cobol/app engine programs. All the processes owned by that user will have the new "maxfiles" limit for the open files.

If you increase maxfiles *kernel* parameter which needs a reboot, then they don't have to change it at their end which is what usually done.

If you have 11i system, you can incrase maxfiles_lim (the hardlimit) dynamically. But the users still have to execute ulimit command to increase their maxfiles parameter.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try