Re: too many open files

David Teran <[email protected]>
Newsgroups gmane.comp.web.webobjects.admin
Message-ID <[email protected]>
Hi Georg,

thats a very interesting observation! In fact calling the GC manually 
is not recommended and i wonder if your app is using a lot of 
FileWriter instances. In every case this might be a bugreport because 
before throwing such an exception the VM should make clear that there 
are no uncollected instances which can be collected to prevent such an 
exception.

Can you check this example on another OS like Linux / Solaris ?

regards David

On 11.02.2004, at 18:46, Georg Tuparev wrote:

> Pierre,
>
> On Feb 11, 2004, at 2:43 PM, Pierre Frisch wrote:
>
>> Can you be a bit more explicit?
>
> Sure
>
>> Each process on MacOS has a limit of 256 open files you must have 
>> open an awful number file to reach that limit?
>
> Well, in my case (I had this headache few months ago) I was opening a 
> huge file containing bank transactions, and  I was splitting them by 
> account (one file for each account). All transactions are sorted  - so 
> at any time I had max two files opened (the source file, and the 
> current account file). This was done in a loop over all accounts. For 
> each output file we do something like this:
>
> FileWriter w = new FileWriter(new File(fileName));
> // Write some data
> w.flush();
> w.close();
> w = null;
>
> One would think this is enough... wrong! We had to kick the GC in 
> order to really free the file handles. Fun, isn't it?
>
>> Or is there another mechanism? Are the file handle in static methods?
>
> In the case of the new application that start making trouble two weeks 
> ago, there were some reads (both in static and instance methods) done 
> using WOResourceManager (some custom SQL, image data etc), and some 
> files similar to what I described above. In both cases they all were 
> closed properly, but we had to kick the GC again.
>
> <dreaming>
> WO 6.0 will be in Objective-C
> </dreaming>
>
> -- georg --
>
> "War is God's way of teaching Americans about geography."
> Ambrose Bierce, writer (1842-1914)
>
> _______________________________________________
> WebObjects-admin mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-admin
>
>

_______________________________________________
WebObjects-admin mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-admin
David Ter??n.vcf (text/directory, 1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.