To Many Open Files Problem
I am running jdk 1.2.2 on Solaris 2.8. I have a java server running and after it recieves about 10 transaction it thorws
java.net.SocketException: Too many open files
How can I tell how many files I have open?
Can I see what files it thinks are open?
Can I tune this parameter?
Thanks
Brian
Hi Brian,
Not sure how you would do this under Solaris, but I had a similar issue
under Linux.
Yes- you can set the parameter. You have to be root in order to change
it at runtime (in your current bash session). The other solution
(I think) is to recompile the kernel.
"ulimit" is the command you are looking for.
I then execute something like this as root:
======
#!/bin/sh
ulimit -n 8096
su myuser -c ./startup
=====
Similar Messages
-
STARTING DATABASE : PROBLEM OF Linux Error: 23: Too many open files in syst
Hi everybody,
I am running an RMAN script and get this error,
9> @/u01/app/oracle/admin/devpose/backup/configuration.rcv
RMAN> ###################################################################
2> # Configuration file used to set Rman policies.
3> #
4> ###################################################################
5>
6> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
RMAN> #CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
2> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
RMAN>
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/backup/db/ora_df%t_s%s_s%p';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
But this problem is understandable, as the database is not running. The main problem why database is not running, I have found the reason but do not understand how to solve the problem.
Since, the database was not running, I tried to startup the database, I then came across the following which is my problem (Why so many files are open? Linux OS error says too many files open. See below,
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 779516 bytes
Variable Size 258743044 bytes
Database Buffers 159383552 bytes
Redo Buffers 524288 bytes
Database mounted.
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/devpose/redo02.log'
ORA-27041: unable to open file
Linux Error: 23: Too many open files in system
Can anybody has run into such problem and guide me to a solution, please?
ThanksHi,
yes, this DB was functioning o.k. this configuration script was part of RMAN daily backup.
Last night the backup failed. So, when I opened "Failed job" in the EM, I saw this type of messages.
That was the starting point. Gradually, I tried to narrow down on to the actual problem and found the findings as I have posted.
One way of sovling problem, I thought that, all these processes I would kill and then try to open the database, it might startup. However, that wouldnot lead me in ensuring this won't occur again.
That's why I am trying to understand why it should open, so many processes (why spawn so many .flb files?) Any thoughts you have around this?
I will try to restart the OS as the last resort.
Thanks for your help and suggestions.
Regards, -
Hi gurus i have a problem on ssl ldap and and and the file descriptors:
OS: SunSolaris 8
Version 1.4.2
ID JDK
Build Level 1.4.2_04-b05
Build Date 06/27/2004
the strange problem is related on too many open files and file descriptors
when a first user login and logoff no related broblems on the /WEB-INF/cacerts files but when a second user login and log off
the files remains open and the output log give the i too many open files the log
] b44131 LdapRegistryI Could not get the users matching the pattern AW504P28 because of the following exception javax.naming.CommunicationException: webldap.IP:PORT [Root exception is java.net.SocketException: Too many open files]
at com.sun.jndi.ldap.Connection.<init>(Connection.java:204)
at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:119)
at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1668)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2599)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:80)
at com.ibm.ws.security.registry.ldap.LdapConfig.getRootDSE(LdapConfig.java:287)
at com.ibm.ws.security.registry.ldap.LdapRegistryImpl.getRootDSE(LdapRegistryImpl.java:181)
at com.ibm.ws.security.registry.ldap.LdapRegistryImpl.search(LdapRegistryImpl.java:1622)
at com.ibm.ws.security.registry.ldap.LdapRegistryImpl.search(LdapRegistryImpl.java:1564)
at com.ibm.ws.security.registry.ldap.LdapRegistryImpl.search(LdapRegistryImpl.java:1559)
at com.ibm.ws.security.registry.ldap.LdapRegistryImpl.getUsers(LdapRegistryImpl.java:1105)
at com.ibm.ws.security.registry.ldap.LdapRegistryImpl.checkPassword(LdapRegistryImpl.java:256)
at com.ibm.ws.security.registry.UserRegistryImpl.checkPassword(UserRegistryImpl.java:277)
at com.ibm.ws.security.ltpa.LTPAServerObject.authenticate(LTPAServerObject.java:565)
at com.ibm.ws.security.server.lm.ltpaLoginModule.login(ltpaLoginModule.java:411)
at com.ibm.ws.security.common.auth.module.proxy.WSLoginModuleProxy.login(WSLoginModuleProxy.java:122)
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
at com.ibm.ws.security.auth.JaasLoginHelper.jaas_login(JaasLoginHelper.java:307)
at com.ibm.ws.security.auth.JaasLoginHelper.jaas_login(JaasLoginHelper.java:349)
at com.ibm.ws.security.auth.ContextManagerImpl.login(ContextManagerImpl.java:1001)
at com.ibm.ws.security.auth.ContextManagerImpl.login(ContextManagerImpl.java:853)
at com.ibm.ws.security.auth.ContextManagerImpl.login(ContextManagerImpl.java:844)
at com.ibm.ws.security.auth.ContextManagerImpl.getServerSubject(ContextManagerImpl.java:1701)
at com.ibm.ws.management.util.SecurityHelper.getServerSubject(SecurityHelper.java:539)
at com.ibm.ws.management.event.NotificationDispatcher$2.run(NotificationDispatcher.java:247)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.management.event.NotificationDispatcher$DispatchANotificationToAListener.setServerCredentials(NotificationDispatcher.java:245)
at com.ibm.ws.management.event.NotificationDispatcher$DispatchANotificationToAListener.run(NotificationDispatcher.java:215)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
Caused by: java.net.SocketException: Too many open files
at java.net.Socket.createImpl(Socket.java:331)
at java.net.Socket.<init>(Socket.java:304)
at java.net.Socket.<init>(Socket.java:124)
at com.sun.jndi.ldap.Connection.createSocket(Connection.java:346)
at com.sun.jndi.ldap.Connection.<init>(Connection.java:181)
what is the cause?
thank you
APsorry i can explain well the issue
for our experience
LDAP access causes the opening a lot of file descriptor?
The LDAP proves ist still running and is still opening files. Meanwhile, because of the SSL communication with application, some files are Created in the CACERTS directory
Suddenly, the OS has reached its file descriptor limit: an error message �Too many open files� appears
Question: the situation is : that files cannot be closed in the CACERT director, because the OS has not more file descriptors (because the ldap process has used all file descriptors to the limit)?
is related on LDAP this problem?
thank you for your kindness guys!
AP -
Java.io.IOException: Too many open files while deploying in soa 11g
hi all,
I am getting a strange error while deploying any composite .. it's a hello world kinda composite but while i am trying to deploy it i am getting "java.io.IOException: Too many open files" while deployment.. i have tried to deploy it in 2-3 ways but all of them resulted in the same error..bouncing the soa server might be an option but can someone give an insight as why it is happening and can it be resolved without restarting the server..
Thanksyes..so this problem is with unix only ..coz i previously worked in Windows ..never got this problem..
-
"java.io.IOException: Too many open files" in LinuX
Hi Developers,
* I am continiously running and processing more than 2000 XML files by using SAX and DOM.....
* My process is as follows,
- Converting the XML file as Document object by DOM....
- And that DOM will be used while creating log file report, that log file will be created after executing all XML files..
* After processing approx 1000 files, it throws *"java.io.IOException: Too many open files" in LinuX system* ....
* I have googled more and more in all sites including sun forum also, but they are telling only to increase the system config by ULIMIT in linux....If i increase that its executing well without exception........
* My question is, Is it possible to do it by JAVA code itself or any other VM arguments like -Xms512m and -Xmx512m.....
* Please let me know , if you have any idea.....
Thanks And Regards,
JavaImranDoh! I forgot to post my little code sample...
package forums.crap;
import java.io.*;
import java.util.*;
public class TooManyFileHandles
private static final int HOW_MANY = 8*1024;
public static void main(String[] args) {
List<PrintWriter> writers = new ArrayList<PrintWriter>(HOW_MANY);
try {
try {
for (int i=1; i<=HOW_MANY; i++ ) {
writers.add(new PrintWriter("file"+i+".txt"));
} finally {
for (PrintWriter w : writers) {
if(w!=null)w.close();
} catch (Exception e) {
e.printStackTrace();
}... and the problem still isn't OOME ;-)
Cheers. Keith. -
WLS 10.3.5 on RHEL 5.4, SocketException: Too many open files
Hi
I'm running Weblogic server 10.3.5 on Red Hat Enterprise Linux Server release 5.4 (Tikanga), with Java jdk1.6.0_27.
My order handling application, when receiving client orders, needs to make outbound SOAP calls to fulfill the order. During a performance test, we got following errors:
####<Feb 10, 2012 2:28:41 PM ICT> <Critical> <Server> <KKMOMAPP2> <KKMOMPE2> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1328858921806> <BEA-002616> <Failed to listen on channel "Default" on 172.24.106.81:4095, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
I monitored the java process of this application, when the "Too many open files" error happened, it had 1388 open file descriptors, among which 655 were sockets.
I also monitored the total open file descriptors of the weblogic user account, the count was around 6300 during this error.
These numbers are far smaller than the file limits configured on OS:
- Under weblogic account, ulimit -n shows 65536
- /proc/sys/fs/file-max shows 772591
- Following lines are already in /etc/security/limits.conf
weblogic soft nofile 65536
weblogic hard nofile 65536
weblogic soft nproc 16384
weblogic hard nproc 16384
I did another test using a simple java program to open large number of sockets under weblogic account. It has no problem to open 15,000 sockets. It seems the file descriptor limit is indeed quite high, but for some reasons, the Weblogic process fails even when it has merely 1388 open files. Are there other Linux or Weblogic parameters I should tune? Or anything else I missed?
Thank you very much
NingHi All,
Any help on this issue ?
Thank you,
Ram -
Java.util.zip.ZipException: Too many open files on Linux
Hi,
We have web application running on Caucho's resin server on jdk 1.5.0_11 and Red hat Linux. We are noticing that java process is running out of file handles within 24-30 hours. We have file limit of 5000 which it consumes in 24 hours throwing 'java.util.zip.ZipException: Too many open files'.
I have made sure all sorts of file handles are closed from application point of view. Here is the snapshot of lsof (list of file handles) from java process. The following list keeps growing until it runs out of limit. Do you have tips/suggestions on how to mitigate this problem (considering we dont want to increase ulimit for this process)? Also, can you make out any thing more from the description of file handles like, are they unclosed POP3 connections or URL connection to external sites?
java 7156 resin 120u IPv4 34930051 UDP localhost.localdomain:59693
java 7156 resin 121u IPv4 34927823 UDP localhost.localdomain:59663
java 7156 resin 122u IPv4 34931861 UDP localhost.localdomain:59739
java 7156 resin 123u IPv4 34932023 UDP localhost.localdomain:59745
java 7156 resin 124u IPv4 34930054 UDP localhost.localdomain:59700
java 7156 resin 125u IPv4 34927826 UDP localhost.localdomain:59665
java 7156 resin 126u IPv4 34927829 UDP localhost.localdomain:59666
java 7156 resin 127u IPv4 34930057 UDP localhost.localdomain:59703
java 7156 resin 128u IPv4 34930713 UDP localhost.localdomain:59727
java 7156 resin 129u IPv4 34930716 UDP localhost.localdomain:59730
java 7156 resin 130u IPv4 34932238 UDP localhost.localdomain:59789
java 7156 resin 131u IPv4 34932026 UDP localhost.localdomain:59749
java 7156 resin 132u IPv4 34932221 UDP localhost.localdomain:59770
java 7156 resin 133u IPv4 34932224 UDP localhost.localdomain:59775
java 7156 resin 134u IPv4 34932029 UDP localhost.localdomain:59753
java 7156 resin 135u IPv4 34932032 UDP localhost.localdomain:59754
java 7156 resin 138u IPv4 34932035 UDP localhost.localdomain:59760
java 7156 resin 139u IPv4 34932038 UDP localhost.localdomain:59763
java 7156 resin 140u IPv4 34932227 UDP localhost.localdomain:59780
java 7156 resin 141u IPv4 34932230 UDP localhost.localdomain:59781
java 7156 resin 144u IPv4 34932234 UDP localhost.localdomain:59786
java 7156 resin 146u IPv4 34932241 UDP localhost.localdomain:59792
java 7156 resin 147u IPv4 34932247 UDP localhost.localdomain:59802Finally we resolved this issue. It was oracle driver which had some compatibility issue, we upgraded our Oracle client driver to newer version, and this fixed the problem. Base line, there was nothing wrong with application code, code was doing good resource clean up, but oracle driver was leaking handles per every connection.
-
Runtime.exec - Too Many Open Files
System version : Red Hat Enterprise Linux 2.4.21-47.ELsmp AS release 3 (Taroon Update 8)
JRE version : 1.6.0-b105
Important : the commands described below are launched from a Web application : Apache Tomcat 6.0.10
Hello,
I'm facing a problem already known, but appearantly never really solved ??!! ;)
When I invoke many system commands with the 'Runtime.exec(...)' method, there are open files that are not released (I can see them with the "lsof" system command) .
At the end, the unavoidable "too many open files" Exception.
The lauched commands are "ssh ... " commands.
In the topics relating to this problem, the solution is always to close all Streams / threads and to explicitely invoke the method "Process.destroy()".
My problem is that this is what I do ! And I can't do more...
Here is the code :
Runtime rt = Runtime.getRuntime();
Process process = rt.exec("ssh ...");
// ProcessStreamHolder extends Thread and reads from the InputStream given in constructor...
ProcessStreamHolder errorStream = new ProcessStreamHolder(process.getErrorStream());
ProcessStreamHolder outputStream = new ProcessStreamHolder(process.getInputStream());
errorStream.start();
outputStream.start();
exitValue = process.waitFor();
try {
errorStream.interrupt();
} catch (RuntimeException e) {
logger.warn("...");
try {
outputStream.interrupt();
} catch (RuntimeException e) {
logger.warn("...");
try {
process.getInputStream().close();
} catch (RuntimeException e) {
logger.warn("...");
try {
process.getOutputStream().close();
} catch (RuntimeException e) {
logger.warn("...");
try {
process.getErrorStream().close();
} catch (RuntimeException e) {
logger.warn("...");
process.destroy();Does someone know if my code is wrong or if there's a workaround for me ?
Thanks by advance !
Richard.Don't interrupt those threads. Close the output stream first, then wait for the process to exit, then both threads reading the stdout and stderr of the process should get EOFs, so they should exit naturally, and incidentally close the streams themselves.
-
Actually, the stuff works in interpreted mode.
It's only when having the server partition compiled that this happen.
j-p
-----Message d'origine-----
De: Adamek, Zenon [mailto:ZAdamekpurolator.com]
Date: lundi 25 septembre 2000 17:13
À: 'Jean-Paul.Gabriellisema.fr'
Cc: Forte-userslists.xpedior.com
Objet: RE: (forte-users) [UNIX] "Too many open files" 3.0.M2 question
see Technote 10981
-----Original Message-----
From: Jean-Paul Gabrielli [SMTP:Jean-Paul.Gabriellisema.fr]
Sent: Monday, September 25, 2000 11:02 AM
To: zeForte-users
Subject: (forte-users) [UNIX] "Too many open files" 3.0.M2 question
Hi,
running a server partition that reads a configuration file,
and apparently doen't close it after, I have that exception:
SYSTEM ERROR: System Error: Too many open files, opening '....'with mode
'r'
Class: qqos_FileResourceException
1) Is there such a limit, or does this rely only on the OS one ?
2) How is this error not trapped, as I only got itinteractively, whereas
my server log does a exception trap/segmentation fault,
thanlks
j-p
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe,send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.comHi Jean-Paul,
As described in the Technote 10981 some Forte programs (Nodemanager and
router) handle correct the high-file descriptor-use problem. It is possible
that Forte interpreter do it correct too.
Zenon
-----Original Message-----
From: Jean-Paul Gabrielli [SMTP:Jean-Paul.Gabriellisema.fr]
Sent: Monday, September 25, 2000 12:11 PM
To: Adamek, Zenon
Cc: Forte-userslists.xpedior.com
Subject: RE: (forte-users) [UNIX] "Too many open files" 3.0.M2
question
Actually, the stuff works in interpreted mode.
It's only when having the server partition compiled that this happen.
j-p
-----Message d'origine-----
De: Adamek, Zenon [mailto:ZAdamekpurolator.com]
Date: lundi 25 septembre 2000 17:13
À: 'Jean-Paul.Gabriellisema.fr'
Cc: Forte-userslists.xpedior.com
Objet: RE: (forte-users) [UNIX] "Too many open files" 3.0.M2 question
see Technote 10981
-----Original Message-----
From: Jean-Paul Gabrielli [SMTP:Jean-Paul.Gabriellisema.fr]
Sent: Monday, September 25, 2000 11:02 AM
To: zeForte-users
Subject: (forte-users) [UNIX] "Too many open files" 3.0.M2 question
Hi,
running a server partition that reads a configuration file,
and apparently doen't close it after, I have that exception:
SYSTEM ERROR: System Error: Too many open files, opening '....'with mode
'r'
Class: qqos_FileResourceException
1) Is there such a limit, or does this rely only on the OS one ?
2) How is this error not trapped, as I only got itinteractively, whereas
my server log does a exception trap/segmentation fault,
thanlks
j-p
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe,send in a new
email the word: 'Unsubscribe' to:
forte-users-requestlists.xpedior.com
>
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com -
Too many open files in system cause database goes down
Hello experts I am very worry because of the following problems. I really hope you can help me.
some server features
OS: Suse Linux Enterprise 10
RAM: 32 GB
CPU: intel QUAD-CORE
DB: There is 3 instances RAC databases (version 11.1.0.7) in the same host.
Problem: The database instances begin to report Error message: Linux-x86_64 Error: 23: Too many open files in system
and here you are other error messages:
ORA-27505: IPC error destroying a port
ORA-27300: OS system dependent operation:close failed with status: 9
ORA-27301: OS failure message: Bad file descriptor
ORA-27302: failure occurred at: skgxpdelpt1
ORA-01115: IO error reading block from file 105 (block # 18845)
ORA-01110: data file 105: '+DATOS/dac/datafile/auditoria.519.738586803'
ORA-15081: failed to submit an I/O operation to a disk
At the same time I search into the /var/log/messages as root user and I the error notice me the same problem:
Feb 7 11:03:58 bls3-1-1 syslog-ng[3346]: Cannot open file /var/log/mail.err for
writing (Too many open files in system)
Feb 7 11:04:56 bls3-1-1 kernel: VFS: file-max limit 131072 reached
Feb 7 11:05:05 bls3-1-1 kernel: oracle[12766]: segfault at fffffffffffffff0 rip
0000000007c76323 rsp 00007fff466dc780 error 4
I think I get clear about the cause, maybe I need to increase the fs.file-max kernel parameter but I do not know how to set a good value. Here you are my sysctl.conf file and the limits.conf file:
sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 4194304
limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536process limit
bcm@bcm-laptop:~$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited -
Getting java.io.FileNotFoundException: Too many open files
I have search for different strings in a file again and again. I am using following code:
try
fileReaderObject = new BufferedReader(new FileReader(fileObject));
String inputLine;
while ((inputLine = fileReaderObject.readLine()) != null)
if (zipCode.equalsIgnoreCase(inputLine.split("\t")[0]))
s = inputLine;
fileReaderObject.close();
return s;
fileReaderObject.close();
catch (Exception e)
Utils.writeMessage(e.toString());
e.printStackTrace();
}But getting java.io.FileNotFoundException:file/emp_info (Too many open files)
1. Whats the main reason of this exception and how can it be removed.
2. Is there any way to move the pointer to the start of the file. I tried reset() but its seems to have some problem.
-vcA hint: your fileReaderObject is not closed if an exception occurs.
Lacking desctructors, the Java-ish way is to close in a finally clause. -
What have "Too many open Files" to do with FIFOs?
Hi folks.
I've just finished a middleware service for my company, that receives files via a TCP/IP connection and stores them into some cache-directory. An external program gets called, consumes the files from the cache directory and puts a result-file there, which itself gets sent back to the client over TCP/IP.
After that's done, the cache file (and everything leftover) gets deleted.
The middleware-server is multithreaded and creates a new thread for each request connection.
These threads are supposed to die when the request is done.
All works fine, cache files get deleted, threads die when they should, the files get consumed by the external program as expected and so on.
BUT (there's always a butt;) to migrate from an older solution, the old data gets fed into the new system, creating about 5 to 8 requests a second.
After a time of about 20-30 minutes, the service drops out with "IOException: Too many open files" on the very line where the external program gets called.
I sweeped through my code, seeking to close even the most unlikely stream, that gets opened (even the outputstreams of the external process ;) but the problem stays.
Things I thought about:
- It's the external program: unlikely since the lsof-command (shows the "list of open files" on Linux) says that the open files belong to java processes. Having a closer look at the list, I see a large amount of "FIFO" entries that gets bigger, plus an (almost) constant amount of "normal" open file handles.
So perhaps the handles get opened (and not closed) somehwere else and the external program is just the drop that makes the cask flood over.
- Must be a file handle that's not closed: I find only the "FIFO" entries to grow. Yet I don't really know what that means. I just think it's something different than a "normal" file handle, but maybe I'm wrong.
- Must be a socket connection that's not closed: at least the client that sends requests to the middleware service closes the connection properly, and I am, well, quite sure that my code does it as well, but who knows? How can I be sure?
That was a long description, most of which will be skipped by you. To boil it down to some questions:
1.) What do the "FIFO" entries of the lsof-command under Linux really mean ?
2.) How can I make damn sure that every socket, stream, filehandle etc. pp. is closed when the worker thread dies?
Answers will be thanked a lot.
TomThanks for the quick replies.
@BIJ001:
ls -l /proc/<PID>/fdGives the same information as lsof does, namely a slowly but steadily growing amount of pipes
fuserDoesn't output anything at all
Do you make exec calls? Are you really sure stdout and stderr are consumed/closed?Well, the external program is called by
Process p = Runtime.getRuntime().exec(commandLine);and the stdout and stderr are consumed by two classes that subclass Thread (named showOutput) that do nothing but prepending the corresponding outputs with "OUT:" and "ERR" and putting them into a log.
Are they closed? I hope so: I call the showOutput's halt method, that should eventually close the handles.
@sjasja:
Sounds like a pipe.Thought so, too ;)
Do you have the waitFor() in there?Mentioning the waitFor():
my code looks more like:
try {
p = Runtime.getRuntime.exec(...);
outshow = new showOutput(p.getInputStream(), "OUT").start;
errshow = new showOutput(p.getErrorStream(), "ERR").start;
p.waitFor();
} catch (InterruptedException e) {
//can't wait for process?
//better go to sleep some.
log.info("Can't wait for process! Going to sleep 10sec.");
try{ Thread.sleep(10000); } catch (InterruptedException ignoreMe) {}
} finally {
if (outShow!=null) outShow.halt();
if (errShow!=null) errShow.halt();
/**within the class showOutput:*/
/**This method gets called by showOutput's halt:*/
public void notifyOfHalt() {
log.debug("Registered a notification to halt");
try {
myReader.close(); //is initialized to read from the given InputStream
} catch (IOException ignoreMe) {}
}Seems as if the both of you are quite sure that the pipes are actually created by the exec command and not closed afterwards.
Would you deem it unlikely that most of the handles are opened somewhere else and the exec command is just the final one that crashes the prog?
That's what I thought.
Thanks for your time
Tom -
ITunes too slow, too many open files, resyncing music
Dear all,
I have those problem with the latest itunes :
- iphone backup takes forever each time
- since I checked "convert to AAC 128" 168 songs are resynchronised over and over
- from time to time i have "two many open files" during sync and need to restore my iphone
I am TIRED of those problems. I am SICK of itunes !
Any solution to this sub standard and quality software ????????
Message was edited by: KesasarThanks but the page http://support.apple.com/kb/DL1037?viewlocale=en_US
talks about the 9.1.1 version
It is true that I have the 9.1.1.11 version -
Weblogic Server Switch over automatically due to too many open files error.
Hi,
I am facing problem in production environment. I am using Weblogic 8.1 SP4 application.
Weblogic Server automatically switch over every 3 weeks due to few reasons.
1. out of memorry error.
2. Too many open files error.
Please see my below portalserver. log files. Kindly provide some good solution to solve this problem.
The following log is portalserver.log file
###<May 6, 2009 8:28:15 PM ICT> <Notice> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000205> <After having failed to listen, the server is now listening on port 9001.>
####<May 6, 2009 8:28:15 PM ICT> <Critical> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 9001, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
####<May 6, 2009 8:28:15 PM ICT> <Error> <HTTP> <ebizdr> <portalServer> <ExecuteThread: '5' for queue: 'default'> <<WLS Kernel>> <> <BEA-101019> <[ServletContext(id=18480784,name=NBIAProject,context-path=)] Servlet failed with IOException
java.io.FileNotFoundException: /var/opt/weblogic/user_projects/domains/eBizPortalDomain/portalServer/.wlnotdelete/NBIAPortalApp/NBIAProject/images/go.gif (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at weblogic.utils.classloaders.FileSource.getInputStream(FileSource.java:23)
at weblogic.servlet.FileServlet.sendFile(FileServlet.java:563)
at weblogic.servlet.FileServlet.service(FileServlet.java:206)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
####<May 6, 2009 8:28:16 PM ICT> <Notice> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000205> <After having failed to listen, the server is now listening on port 9001.>
####<May 6, 2009 8:28:16 PM ICT> <Critical> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 9001, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
####<May 6, 2009 8:28:16 PM ICT> <Error> <HTTP> <ebizdr> <portalServer> <ExecuteThread: '5' for queue: 'default'> <<WLS Kernel>> <> <BEA-101019> <[ServletContext(id=18480784,name=NBIAProject,context-path=)] Servlet failed with IOException
java.io.FileNotFoundException: /var/opt/weblogic/user_projects/domains/eBizPortalDomain/portalServer/.wlnotdelete/NBIAPortalApp/NBIAProject/images/search_right.gif (Too many open files)
Thanks & Regards,
Suriyaprakash.VSorry for the late resp. Here's what dev suggests be investigated:
I would want to know:
Can they do a "$ORACLE_HOME/bin/dmstool -dump" and
save/compress/send the results?
Are there any errors printed in the Apache error_log while this leak occurs?
The customer could/should re-check their TCP settings, especially the TCP time wait interval and generally follow the TCP settings recommended in Chapter 5 of the iAS Performance Guide for 9.0.2.
Is there anything else interesting/unusual about the site?
Let us know how it goes. -
Hello, I am trying to update a couple apps on my ipad 2 over wifi. (sudoku, twitter, rummikub)
I am logged in correctly,
No apps are currently open (except app store).
When I type in my apple id password to update all 3, a text box comes up and says "too many open files". and then gives me the option to cancel or retry.
I have tried a hard reset and the problem continues.
I have also tried to update the apps individually and each one has the same error.
Suggestions?
ThanksReceived the same error.
I had previously disconnected from iTunes without ejecting it.
I connected my Ipad3 to my Laptop/itunes and Ejected it from iTunes.
Error cleared up.
Maybe you are looking for
-
Import data to 9i from 11g export error.
Dear All, My new production server has 11g up running. I like to move data from the 11g to the legacy system of 9i as a backup server. Both servers are Linux. Both 9i and 11g clients are installed on a XP computer. I found the information that I need
-
Problem in enabling numkeypad as mouse cursor
Robot robot=new Roobot(); robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_ SHIFT); robot.keyPress(KeyEvent.VK_NUM_LOCK); robot.keyPress(KeyEvent.VK_NUMPAD2); This code is used for moving the mouse cursor but it is not working. It is under
-
Routing and Remote access - internal network not accessing internet through public network!
Hello, Good Evening to all. I got an issue in routing and remote access on windows 2003 server. This server is already configured as File server, domain server and Application server. Also configured as router (through routing & remote access) for c
-
Hi, is Photoshop Touch compatible with all the tablets on the market?
is there any restriction on screen size or specs?
-
Server rejected password on email account
Server keeps rejecting the password on my email account and I can't receive emails.