my dog learned polymorphism
The moose likes I/O and Streams and the fly likes Too many open files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark " Too many open files" Watch " Too many open files" New topic
Author Too many open files

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 833

Here is my code to copy file

Error that am facing is:

Thanks in anticipation
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

As far as I can see, the code that you posted doesn't have anything to do with your error message. Here's the relevant part of the stack trace:

Notice that the classes and mentioned in that stack trace are not in the code which you posted.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 833
Thanks Paul Clapham for your favorable reply. Actually the referred classes are using this copy method and exist in the class from where this copyFile method called

I googled and found this problem not belongs to my code but appearing due to Linux as permission to view number of files were 1024 whereas I was trying to copy 50500 files. I used the following to fix it:

Increase open files and max user processes:

Presently it seems the problem fixed but am still waiting to be sure 100%

Thanks again
I agree. Here's the link:
subject: Too many open files
It's not a secret anymore!