Too Many Open Files - Java
Hi All, I have a interesting problem which I have done a work around on, but in a nutshell, I have a java to MS-SQL application which uses JDBC to communicate, there is no problem with port access, but every so often, the java process will spit out: Too Many Open Files and croak. Now, according to several sources, I should be able to increase the max number of open files per process with 'ulimit -n <nnnn> where nnnn is the number of files I want. However, when I attempt to do this, I get a message from BASH stating: billp@nermal:~> ulimit -n 4096 bash: ulimit: cannot modify limit: Operation not permitted Here is a output from ulimit -a core file size (blocks) 0 data seg size (kbytes) unlimited file size (blocks) unlimited max locked memory (kbytes) unlimited max memory size (kbytes) unlimited open files 1024 pipe size (512 bytes) 8 stack size (kbytes) unlimited cpu time (seconds) unlimited max user processes 8191 virtual memory (kbytes) unlimited Now, if I do this as root, it doesn't complain at all (works for the session only). I have tried to modify /etc/security/limits.conf and /etc/pam.d/login to compensate, but all have resulted in no success. To work around the problem, I had to re-compile the linux kernel and change the value of 'INR_OPEN' in /usr/src/linux/include/linux/fs.h from 1024 to 4096, which gives me more files per process. On a machine which has the new kernel, this is what ulimit -a now produces: core file size (blocks) 0 data seg size (kbytes) unlimited file size (blocks) unlimited max locked memory (kbytes) unlimited max memory size (kbytes) unlimited open files 4096 pipe size (512 bytes) 8 stack size (kbytes) unlimited cpu time (seconds) unlimited max user processes 2048 virtual memory (kbytes) unlimited According to information I have read, the default open file limit per process is defined at 1024 (is this correct), and did I do this the correct way? I have also increased the value of /proc/sys/fs/file-max to 32767 on system boot up by doing echo 32767 > /proc/sys/fs/file-max -Bill
Dear friends, I have been unable to finally decide amongst two things. What I know for sure is that - 1. With SL 8.1, the package Java does not work. [I have heard it said that there is a problem with the way Java was written - that it can not take what gcc-3.2 demands of it.] 2. On the other hand I have also heard that gcc-3.2 compiled binaries have trouble linking with gcc-2.95.2 made libraries? Which one[s] of these are true? Should I or should I not compile my code with gcc-3.2, since existing binaries are with gcc-2.95.2 all over the place? Is the Java issue related to this mismatch in any way? Please give authoritative answer - this is a request. Rohit ********************************************************* Disclaimer This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. ********************************************************* Visit us at http://www.mahindrabt.com
On Dec 10, 2002, Rohit wrote:
I have been unable to finally decide amongst two things. What I know for sure is that -
1. With SL 8.1, the package Java does not work. [I have heard it said that there is a problem with the way Java was written - that it can not take what gcc-3.2 demands of it.]
True that Sun will not compile Java with gcc-3.2. Not yet at least. But it works fine. It's only Java together with Mozilla that does not work since Java is compiled with gcc-2.95 and Mozilla compiled by SuSE that is gcc-3.2.
2. On the other hand I have also heard that gcc-3.2 compiled binaries have trouble linking with gcc-2.95.2 made libraries?
Yes, there is a binary incompatibility.
Which one[s] of these are true? Should I or should I not compile my code with gcc-3.2, since existing binaries are with gcc-2.95.2 all over the place? Is the Java issue related to this mismatch in any way?
What do you want to compile? -- Mads Martin Jørgensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort?" -- A. P. J.
On Tue, 10 Dec 2002 08:47:15 +0100 Mads Martin Joergensen <mmj@suse.de> wrote:
On Dec 10, 2002, Rohit wrote:
I have been unable to finally decide amongst two things. What I know for sure is that -
1. With SL 8.1, the package Java does not work. [I have heard it said that there is a problem with the way Java was written - that it can not take what gcc-3.2 demands of it.]
True that Sun will not compile Java with gcc-3.2. Not yet at least. But it works fine. It's only Java together with Mozilla that does not work since Java is compiled with gcc-2.95 and Mozilla compiled by SuSE that is gcc-3.2.
2. On the other hand I have also heard that gcc-3.2 compiled binaries have trouble linking with gcc-2.95.2 made libraries?
Yes, there is a binary incompatibility.
Which one[s] of these are true? Should I or should I not compile my code with gcc-3.2, since existing binaries are with gcc-2.95.2 all over the place? Is the Java issue related to this mismatch in any way?
What do you want to compile?
It took me a while to work out but Gambas (Great RAD type prog) is compiled with 2.95 and wont run with 3.2. I don't have a clue how to get it to work with 2.95 though. steve.
True that Sun will not compile Java with gcc-3.2. Not yet at least. But it works fine. It's only Java together with Mozilla that does not work since Java is compiled with gcc-2.95 and Mozilla compiled by SuSE that is gcc-3.2.
In which case - any third party application which is compiled with gcc-2.95x will not run with SuSE 8.x. Please help me understand this. 1. 8.1x is a platform completed built with gcc-3.2 2. Shall a static binary build with gcc-2.95.2 work on it? It would talk only to the kernel using standard system calls - or is there a problem/dependency there too? 3. Shall a binary [built with gcc-2.95.2] which uses shared libs [which in this case - may come from /usr/lib etc, compiled with gcc-3.2] from the system, work? 4. Is there a reference I can look into, to understand it better? I am googling meanwhile. Thanks a lot - for responses in anticipation. Rohit ********************************************************* Disclaimer This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. ********************************************************* Visit us at http://www.mahindrabt.com
On Dec 10, 2002, Rohit wrote:
True that Sun will not compile Java with gcc-3.2. Not yet at least. But it works fine. It's only Java together with Mozilla that does not work since Java is compiled with gcc-2.95 and Mozilla compiled by SuSE that is gcc-3.2.
In which case - any third party application which is compiled with gcc-2.95x will not run with SuSE 8.x. Please help me understand this.
Not necessarily.
1. 8.1x is a platform completed built with gcc-3.2
Yes.
2. Shall a static binary build with gcc-2.95.2 work on it? It would talk only to the kernel using standard system calls - or is there a problem/dependency there too?
Of course a static binary will work.
3. Shall a binary [built with gcc-2.95.2] which uses shared libs [which in this case - may come from /usr/lib etc, compiled with gcc-3.2] from the system, work?
Depends! The big problem are only present with C++ which had API changes.
4. Is there a reference I can look into, to understand it better?
Understanding how compilers and libraries work is a good source.
I am googling meanwhile. Thanks a lot - for responses in anticipation.
Why can't you just tell us what you intend to do? -- Mads Martin Jørgensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort?" -- A. P. J.
Depends! The big problem are only present with C++ which had API changes.
Hmm.. okay.
Why can't you just tell us what you intend to do?
Working on some one million lines of code which is to be portable to Linux [preferably without having to do a version check] - once compiled, should run on all [recent/decent linux]. So thinking what to compile the thing with? Or whether to ship two separate versions - depending upon the g/libc? Rohit ********************************************************* Disclaimer This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. ********************************************************* Visit us at http://www.mahindrabt.com
On Dec 10, 2002, Rohit wrote:
Depends! The big problem are only present with C++ which had API changes.
Hmm.. okay.
Why can't you just tell us what you intend to do?
Working on some one million lines of code which is to be portable to Linux [preferably without having to do a version check] - once compiled, should run on all [recent/decent linux]. So thinking what to compile the thing with? Or whether to ship two separate versions - depending upon the g/libc?
Hmmm, until we all use the same compiler, I think you might need to compile one with 2.95.3 and one with 3.2 and then get as many distributions you want to support and test if it works. Or compile it statically. -- Mads Martin Jørgensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort?" -- A. P. J.
On Tue, 2002-12-10 at 01:47, Mads Martin Joergensen wrote:
True that Sun will not compile Java with gcc-3.2. Not yet at least. But it works fine. It's only Java together with Mozilla that does not work since Java is compiled with gcc-2.95 and Mozilla compiled by SuSE that is gcc-3.2.
I noticed that jse-1.4.1.01 was released in November. Has anyone tried to compile this to get it to work with mozilla? I can't find anything in their changelog addressing the gcc-3.2 issue. -jeric -- JericAtSbcglobalDotNetwork 10:52am up 20 days, 2:41, 8 users, load average: 0.22, 0.09, 0.03
On Dec 10, 2002, Jeric wrote:
True that Sun will not compile Java with gcc-3.2. Not yet at least. But it works fine. It's only Java together with Mozilla that does not work since Java is compiled with gcc-2.95 and Mozilla compiled by SuSE that is gcc-3.2.
I noticed that jse-1.4.1.01 was released in November. Has anyone tried to compile this to get it to work with mozilla? I can't find anything in their changelog addressing the gcc-3.2 issue.
We have. Does not work. And Sun are not really nice, just read this quote: 1) We don't support Mozilla, at this time and 2) If we did support it, it would be the pre-built verison on the mozilla.org website (which BTW works with the current plugin). -- Mads Martin Jørgensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort?" -- A. P. J.
1) We don't support Mozilla, at this time and 2) If we did support it, it would be the pre-built verison on the mozilla.org website (which BTW works with the current plugin).
I think this is because it's built with gcc 2.95.x If you just want to use Java with Mozilla, you can grab the Mozilla packages from www.usr-local-bin.org - amongst other goodness, they're built with gcc 2.95.2, so Java (and flash) works. It also fixes a Radio Button problem with Mozilla built with gcc 3.2. And yes, I am still working on the 1.2 packages, I'm aiming to have a GTK2 build ready by the end of this week, even if it's back to a single package, rather than separating out mail, irc, venkman etc... -- James Ogley, Webmaster, Rubber Turnip james@rubberturnip.org.uk http://www.rubberturnip.org.uk Jabber: riggwelter@myjabber.net Using Free Software since 1994, running GNU/Linux (SuSE 8.1). GNOME updates for SuSE: http://www.usr-local-bin.org
On Dec 10, 2002, James Ogley wrote:
1) We don't support Mozilla, at this time and 2) If we did support it, it would be the pre-built verison on the mozilla.org website (which BTW works with the current plugin).
I think this is because it's built with gcc 2.95.x
Of course. That's what we've been saying all along, and what the whole discussion was about. -- Mads Martin Jørgensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort?" -- A. P. J.
participants (6)
-
Bill Parker
-
James Ogley
-
Jeric
-
Mads Martin Joergensen
-
Rohit
-
Steve Nicholls