I have a big problem and that is that my company's production application which I unfortunately can't shutdown and restart ( I am unsure how, and I don't want to do any mistake) is spitting out a lot of exceptions on too many files open when trying to open a socket to read from an ftp server.
2013-01-02 16:19:03,222 ERROR [main] software.background.Program(Program.java:doExecute{225}) - Exception during ftp transfer
someclasses.ftp.FtpException: Could not create connection to xxxx
at someclasses.communication.ftp.FtpImpl.connect(FtpImpl.java:114)
at Program.doExecute(Program.java:176)
at Program.main(Program.java:287)
Caused by: java.net.SocketException: Too many open files
at java.net.Socket.createImpl(Socket.java:397)
at java.net.Socket.<init>(Socket.java:371)
at java.net.Socket.<init>(Socket.java:189)
at someclasses.Ftp.connect(Ftp.java:386)
I understand that the per application limit of open files / sockets and so on is reached. Is there any way to increase this maximum for the time being without closing the application? I have run the command ulimit
and it states unlimited
. I've tried to check how many connections it has open with the lsof -p PID
command but it states "command not found".
Would be very glad if someone could help me find another similar effect that lsof has (I think it's a red hat machine) and advice for how to fix this temporary? The most pleasant solution to this would be to increase the files / sockets the application could open. This is just a plain java application.
Thanks in advance!
EDIT another solution would be if there were any command where I could look up how this program was run from the beginning with all the eventual flags. Then I maybe could restart it with success. This is a legacy app.