Even though I close all files it says "too many open files" :(
Hi,
basically, i use the RandomAccessFile class to write to files. Max I've tried is around 20 files. There is only one file open at any given time.
I have ensured this cos while debuggin I wrote "increment" and "decrement" methods, and ran them after I opened and closed a file respectively. Obviously increment and decrement add 1 and minus 1 respectively from an interger variable instantiated to 0. Increment and decrement are implemented as synchronized methods!
According to my monitoring of my program during run time using the above methods no more than one file is ever open at any time!
However after a while of running my java program crashes with "too many open files" as the error.
I dunno if any of you know what this is but im using Jasper (java interface for sicstus prolog) as part of my java program. Its an academic individual project.
I've racked my brains trying to fix this error but I cant seem to get anywhere.
I thought it could be a bug within netbeans 5 (i test run my program within the netbeans IDE) or it could be a bug in jasper! Or more likely a bug in my code! Im using Java 1.5.
Does anyone have any tips or ideas?
Also, is there a way to monitor the number of files opened by a java process? Im runnin XP!
ANY help would be much appreciated :)

