Symbian
Symbian OS Library

FAQ-0452 Is there an open file limit in Java?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: General
Created: 12/13/99 Modified: 06/22/2001
Number: FAQ-0452
Platform: ER5

Question:
My Java app runs fine on EPOC opening 20 files concurrently. But when I increase that number to 30, it crashes with an IOException being thrown from the RandomAccessFile constructor. Is this a consequence of a limit in EPOC on the number of files which can be held open concurrently by an app/process?

Answer:
There is no restriction from the EPOC file server itself on the number of open files. However, STDLIB, which is used by Java for all file i/o, allocates a fixed number of file descriptors per process (that number is 32). The first three are allocated to stdin, stdout and stderr. Another is allocated to classes.zip, leaving a maximum of 28 for the application. Other jar or zip files used by the app will reduce the available number even further.
17/3/00 Note added: this has been fixed for future releases of the EPOC Runtime for Java so that the number of files can be increased without limit.